@jeromefitz/notion 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/constants/index.cjs +0 -0
  4. package/constants/index.d.ts +0 -0
  5. package/constants/index.js +0 -0
  6. package/index.cjs +1 -1
  7. package/index.d.ts +0 -0
  8. package/index.js +1 -1
  9. package/package.json +11 -6
  10. package/queries/getBlocksByIdChildren/index.cjs +0 -0
  11. package/queries/getBlocksByIdChildren/index.d.ts +0 -0
  12. package/queries/getBlocksByIdChildren/index.js +0 -0
  13. package/queries/getDatabasesByIdQuery/index.cjs +0 -0
  14. package/queries/getDatabasesByIdQuery/index.d.ts +0 -0
  15. package/queries/getDatabasesByIdQuery/index.js +0 -0
  16. package/queries/getDeepFetchAllChildren/index.cjs +0 -0
  17. package/queries/getDeepFetchAllChildren/index.d.ts +0 -0
  18. package/queries/getDeepFetchAllChildren/index.js +0 -0
  19. package/queries/getInfoType/index.cjs +1 -1
  20. package/queries/getInfoType/index.d.ts +0 -0
  21. package/queries/getInfoType/index.js +1 -1
  22. package/queries/getNotionListing/index.cjs +1 -1
  23. package/queries/getNotionListing/index.d.ts +0 -0
  24. package/queries/getNotionListing/index.js +1 -1
  25. package/queries/getNotionListingByDate/index.cjs +1 -1
  26. package/queries/getNotionListingByDate/index.d.ts +0 -0
  27. package/queries/getNotionListingByDate/index.js +1 -1
  28. package/queries/getNotionSlug/index.cjs +1 -1
  29. package/queries/getNotionSlug/index.d.ts +0 -0
  30. package/queries/getNotionSlug/index.js +1 -1
  31. package/queries/getNotionSlugByRoute/index.cjs +1 -1
  32. package/queries/getNotionSlugByRoute/index.d.ts +0 -0
  33. package/queries/getNotionSlugByRoute/index.js +1 -1
  34. package/queries/getPagesById/index.cjs +0 -0
  35. package/queries/getPagesById/index.d.ts +0 -0
  36. package/queries/getPagesById/index.js +0 -0
  37. package/queries/getPathVariables/index.cjs +0 -0
  38. package/queries/getPathVariables/index.d.ts +0 -0
  39. package/queries/getPathVariables/index.js +0 -0
  40. package/queries/getQuery/index.cjs +1 -1
  41. package/queries/getQuery/index.d.ts +0 -0
  42. package/queries/getQuery/index.js +1 -1
  43. package/queries/index.cjs +1 -1
  44. package/queries/index.d.ts +0 -0
  45. package/queries/index.js +1 -1
  46. package/schema/index.cjs +1 -1
  47. package/schema/index.d.ts +3 -0
  48. package/schema/index.js +0 -0
  49. package/utils/addTime/index.cjs +0 -0
  50. package/utils/addTime/index.d.ts +0 -0
  51. package/utils/addTime/index.js +0 -0
  52. package/utils/dataNormalized/index.cjs +1 -1
  53. package/utils/dataNormalized/index.d.ts +0 -0
  54. package/utils/dataNormalized/index.js +1 -1
  55. package/utils/dataNormalizedResults/index.cjs +1 -1
  56. package/utils/dataNormalizedResults/index.d.ts +0 -0
  57. package/utils/dataNormalizedResults/index.js +1 -1
  58. package/utils/getDataType/index.cjs +0 -0
  59. package/utils/getDataType/index.d.ts +0 -0
  60. package/utils/getDataType/index.js +0 -0
  61. package/utils/getTitle/index.cjs +0 -0
  62. package/utils/getTitle/index.d.ts +0 -0
  63. package/utils/getTitle/index.js +0 -0
  64. package/utils/getTypes/_unsupported.cjs +0 -0
  65. package/utils/getTypes/_unsupported.d.ts +0 -0
  66. package/utils/getTypes/_unsupported.js +0 -0
  67. package/utils/getTypes/checkbox.cjs +0 -0
  68. package/utils/getTypes/checkbox.d.ts +0 -0
  69. package/utils/getTypes/checkbox.js +0 -0
  70. package/utils/getTypes/date.cjs +0 -0
  71. package/utils/getTypes/date.d.ts +0 -0
  72. package/utils/getTypes/date.js +0 -0
  73. package/utils/getTypes/email.cjs +0 -0
  74. package/utils/getTypes/email.d.ts +0 -0
  75. package/utils/getTypes/email.js +0 -0
  76. package/utils/getTypes/files.cjs +0 -0
  77. package/utils/getTypes/files.d.ts +0 -0
  78. package/utils/getTypes/files.js +0 -0
  79. package/utils/getTypes/index.cjs +0 -0
  80. package/utils/getTypes/index.d.ts +0 -0
  81. package/utils/getTypes/index.js +0 -0
  82. package/utils/getTypes/multi_select.cjs +0 -0
  83. package/utils/getTypes/multi_select.d.ts +0 -0
  84. package/utils/getTypes/multi_select.js +0 -0
  85. package/utils/getTypes/number.cjs +0 -0
  86. package/utils/getTypes/number.d.ts +0 -0
  87. package/utils/getTypes/number.js +0 -0
  88. package/utils/getTypes/people.cjs +0 -0
  89. package/utils/getTypes/people.d.ts +0 -0
  90. package/utils/getTypes/people.js +0 -0
  91. package/utils/getTypes/phone_number.cjs +0 -0
  92. package/utils/getTypes/phone_number.d.ts +0 -0
  93. package/utils/getTypes/phone_number.js +0 -0
  94. package/utils/getTypes/relation.cjs +0 -0
  95. package/utils/getTypes/relation.d.ts +0 -0
  96. package/utils/getTypes/relation.js +0 -0
  97. package/utils/getTypes/rich_text.cjs +0 -0
  98. package/utils/getTypes/rich_text.d.ts +0 -0
  99. package/utils/getTypes/rich_text.js +0 -0
  100. package/utils/getTypes/rollup.cjs +0 -0
  101. package/utils/getTypes/rollup.d.ts +0 -0
  102. package/utils/getTypes/rollup.js +0 -0
  103. package/utils/getTypes/select.cjs +0 -0
  104. package/utils/getTypes/select.d.ts +0 -0
  105. package/utils/getTypes/select.js +0 -0
  106. package/utils/getTypes/title.cjs +0 -0
  107. package/utils/getTypes/title.d.ts +0 -0
  108. package/utils/getTypes/title.js +0 -0
  109. package/utils/getTypes/url.cjs +0 -0
  110. package/utils/getTypes/url.d.ts +0 -0
  111. package/utils/getTypes/url.js +0 -0
  112. package/utils/index.cjs +1 -1
  113. package/utils/index.d.ts +0 -0
  114. package/utils/index.js +1 -1
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
package/index.cjs CHANGED
@@ -1 +1 @@
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});
1
+ var ft=Object.create;var N=Object.defineProperty,Et=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Tt=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertyNames,ue=Object.getOwnPropertySymbols,bt=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable;var ce=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t)=>{for(var n in t||(t={}))de.call(t,n)&&ce(e,n,t[n]);if(ue)for(var n of ue(t))It.call(t,n)&&ce(e,n,t[n]);return e},f=(e,t)=>Et(e,Tt(t)),ye=e=>N(e,"__esModule",{value:!0});var Dt=(e,t)=>{for(var n in t)N(e,n,{get:t[n],enumerable:!0})},me=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of kt(t))!de.call(e,r)&&(n||r!=="default")&&N(e,r,{get:()=>t[r],enumerable:!(p=wt(t,r))||p.enumerable});return e},l=(e,t)=>me(ye(N(e!=null?ft(bt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Ct=(e=>(t,n)=>e&&e.get(t)||(n=me(ye({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var So={};Dt(So,{Client:()=>gt});var Pt=l(require("@notionhq/client"),1);var C=l(require("lodash/filter.js"),1),he=l(require("lodash/map.js"),1),O=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},v=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Se=[...v],Pe=[...v,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],ge=[...v,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],fe=[...v],Ee=[...v,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],we=[...v,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Te=[...v],ke=[...v,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],be=[...v,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],go={BLOG:(0,C.default)(Se,{init:!0}),EPISODES:(0,C.default)(Pe,{init:!0}),EVENTS:(0,C.default)(ge,{init:!0}),PAGES:(0,C.default)(fe,{init:!0}),PEOPLE:(0,C.default)(Ee,{init:!0}),PODCASTS:(0,C.default)(we,{init:!0}),SEO:(0,C.default)(Te,{init:!0}),SHOWS:(0,C.default)(ke,{init:!0}),VENUES:(0,C.default)(be,{init:!0})},Ie={BLOG:Se.map(e=>O(e)),EPISODES:Pe.map(e=>O(e)),EVENTS:ge.map(e=>O(e)),PAGES:fe.map(e=>O(e)),PEOPLE:Ee.map(e=>O(e)),PODCASTS:we.map(e=>O(e)),SEO:Te.map(e=>O(e)),SHOWS:ke.map(e=>O(e)),VENUES:be.map(e=>O(e))},De=(0,he.default)(o,e=>O(e)),Ce=new Date().toISOString(),x={dateBefore:{property:o.datePublished.notion,date:{before:Ce}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:Ce}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Ot="LISTING",vt="LISTING_BY_DATE",xt="SLUG",Lt="SLUG_BY_ROUTE",Bt=[Ot,vt,xt,Lt],b=Object.assign({},...Bt.map(e=>({[e]:e})).flat(1));var A=l(require("@jeromefitz/utils"),1),Nt=async({getBlocksChildrenList:e,block_id:t})=>(0,A.isUndefined)(t)?[]:(await(0,A.avoidRateLimit)(),await e({block_id:t})),F=Nt;var B={sorts:[{property:o.slug.notion,direction:"ascending"}]},Rt=async({database_id:e,filter:t=B==null?void 0:B.filter,getDatabasesQuery:n,sorts:p=B==null?void 0:B.sorts})=>e?await n({database_id:e,sorts:p,filter:t}):[],W=Rt;var Oe=async({getBlocksChildrenList:e,blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>{let{id:i}=r;return{promise:e({block_id:i,page_size:100}),parent_block:r}}),p=await Promise.all(n.map(r=>r.promise));for(let r=0;r<p.length;r++){let i=p[r].results;if(await Oe({blocks:i,getBlocksChildrenList:e}),n[r]){let _=n[r].parent_block;_[_.type].children=i}}return t},Y=Oe;var Gt=({config:e,item:t,routeType:n,meta:p})=>{var c,h;let{NOTION:r}=e,i="",_=(c=t.properties)==null?void 0:c.slug,s="",m="/[...catchAll]";switch(n){case r.BLOG.routeType:case r.EVENTS.routeType:i=(h=t.properties[r[n.toUpperCase()].infoType.key])==null?void 0:h.start.slice(0,10);let[a,u,y]=i==null?void 0:i.split("-");s=`/${n}/${a}/${u}/${y}/${_}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${p==null?void 0:p.join("/")}/${_}`;break;default:s=`/${n}/${_}`;break}return s=s.replace("//","/"),{as:s,date:i,href:m,slug:_}},z=Gt;var K=l(require("@jeromefitz/utils"),1),nt=l(require("lodash/map.js"),1),V=l(require("lodash/omit.js"),1);var j=l(require("date-fns/addDays/index.js"),1),ve=l(require("date-fns/addMonths/index.js"),1),xe=l(require("date-fns/addYears/index.js"),1),At=(e,t)=>{switch(t){case"year":return(0,xe.default)(e,1).toISOString();case"month":return(0,ve.default)(e,1).toISOString();case"day":return(0,j.default)(e,2).toISOString()}return(0,j.default)(e,-1).toISOString()},I=At;var Le=l(require("lodash/map.js"),1);var Ut=({config:e,data:t,pathVariables:n,pageId:p})=>{var c,h;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:_}=t,s="";if(n){let{meta:a,routeType:u}=n;s=u===((c=r==null?void 0:r.PODCASTS)==null?void 0:c.routeType)&&a.length>1?(h=r==null?void 0:r.EPISODES)==null?void 0:h.routeType:u}let m=s?Ie[s.toUpperCase()]:De;return(0,Le.default)(m,a=>{let u,y=_[a.notion];i[a.key]=null,y&&(u=L[a.type](y,p),i[a.key]=u||null)}),i},w=Ut;var Be=l(require("@jeromefitz/utils"),1),Ne=l(require("lodash/map.js"),1),Re=l(require("lodash/omit.js"),1);var Mt=({config:e,results:t,routeType:n})=>{let p=[];return(0,Ne.default)(t,r=>{let i=(0,Re.default)(r,"properties");i.properties=(0,Be.sortObject)(w({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),p.push(i)}),p},Ge=Mt;var Vt=({isPage:e,isIndex:t,hasMeta:n})=>e?b.SLUG:t&&!n?b.LISTING:t&&n?b.LISTING_BY_DATE:n?b.SLUG_BY_ROUTE:b.SLUG,$=Vt;var Ht=e=>(console.dir("@notion(_unsupported)"),e),U=Ht;var Qt=e=>e.checkbox||!1,Ae=Qt;var Ft=e=>{let{type:t}=e;return e[t]},M=Ft;var Wt=e=>e.email||null,Ue=Wt;var Me=l(require("@jeromefitz/utils"),1),Ve=l(require("github-slugger"),1),He=l(require("lodash/size.js"),1),Yt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",zt=(e,t)=>Yt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,Me.stringToUUID)(t)),jt=(e,t)=>{let n=new Ve.default,p={};return(0,He.default)(e.files)<=0||e.files.map(r=>{var i,_;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],m=n.slug(s);p[m]={type:r==null?void 0:r.type,url:zt(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(_=r==null?void 0:r.external)==null?void 0:_.url.split("?")[0],m=n.slug(s);p[m]={type:r==null?void 0:r.type,url:s}}}),p},q=jt;var Qe=l(require("github-slugger"),1),Fe=l(require("lodash/map.js"),1),$t=e=>{let t=new Qe.default,n={};return(0,Fe.default)(e.multi_select,p=>{let r=p;r.slug=t.slug(r.name),n[r.id]=r}),n},We=$t;var qt=e=>(e==null?void 0:e.number)||null,Ye=qt;var ze=l(require("github-slugger"),1),Zt=e=>{let t=new ze.default;return e.people.map(n=>{let{avatar_url:p,id:r,name:i,person:_}=n,{email:s}=_;return{[t.slug(i)]:{avatar_url:p,email:s,id:r,name:i}}})[0]},je=Zt;var Kt=e=>(e==null?void 0:e.phone_number)||null,$e=Kt;var Z=l(require("lodash/map.js"),1);var Jt=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,Z.default)(e.rollup.array,t=>L[t.type](t))[0]:(0,Z.default)(e.relation,t=>t.id),qe=Jt;var Xt=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},Ze=Xt;var Ke=l(require("lodash/map.js"),1),Je=l(require("lodash/sortBy.js"),1);var eo=e=>{var t;return(0,Je.default)((0,Ke.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>L[n.type](n)))},Xe=eo;var et=l(require("github-slugger"),1),to=e=>{let t=new et.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},tt=to;var oo=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},ot=oo;var ro=e=>e.url||null,rt=ro;var no={checkbox:Ae,created_by:U,created_time:M,date:M,email:Ue,files:q,formula:U,image:q,last_edited_by:U,last_edited_time:M,multi_select:We,number:Ye,people:je,phone_number:$e,relation:qe,rich_text:Ze,rollup:Xe,select:tt,title:ot,url:rt},L=no;var io=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i})=>{let{NOTION:_}=e,s={},m=new Date().toISOString(),c=new Date("2020-01-01").toISOString(),h=_[i.toUpperCase()].page_id__seo,a=await p({page_id:h});if(!a)return{};(a==null?void 0:a.object)==="page"&&(s=(0,V.default)(a,"properties"),s.properties=(0,K.sortObject)(w({config:e,data:a,pathVariables:r,pageId:s.id})));let u=_.EVENTS.routeType===i,y=_[i.toUpperCase()].infoType.notion??o.datePublished.notion,P=await t({block_id:s.id}),S=await n({database_id:_[i.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:u?m:c}}]}}),E=[];(0,nt.default)(S.results,k=>{let D=k;D=(0,V.default)(D,"properties"),D.properties=(0,K.sortObject)(w({config:e,data:k,pathVariables:r,pageId:k.id})),E.push(D)});let T=(0,V.default)(S,"results");return T.results=E,{info:s,content:P,items:T,images:{}}},J=io;var X=l(require("@jeromefitz/utils"),1),it=l(require("lodash/map.js"),1),R=l(require("lodash/omit.js"),1),st=l(require("lodash/size.js"),1);var so=({config:e,pathVariables:t,routeType:n,slug:p})=>{var y,P;let{NOTION:r}=e,{meta:i}=t,[_,s,m]=i,c=(0,st.default)(i),h=new Date().toISOString(),a=new Date(`${_||h.slice(0,4)}-${s||"01"}-${m||"01"}`),u=((P=(y=r[n.toUpperCase()])==null?void 0:y.infoType)==null?void 0:P.notion)??o.datePublished.notion;switch(c){case 1:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"year")}}]};case 2:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"month")}}]};case 3:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"day")}}]};default:return{and:[{property:u,date:{on_or_after:I(a,"")}},{property:u,date:{before:I(a,"day")}},f(g({},x.slug),{text:{equals:p}})]}}},ao=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s}=e,m={},c={},h=s[i.toUpperCase()].page_id__seo,a=await p({page_id:h});a.object==="page"&&(c=(0,R.default)(a,"properties"),c.properties=(0,X.sortObject)(w({config:e,data:a,pathVariables:r,pageId:a.id}))),m=await t({block_id:c.id});let u=[{property:o.datePublished.notion,direction:"descending"}],y=so({config:e,pathVariables:r,routeType:i,slug:_}),P=s[i.toUpperCase()].database_id,S=await n({database_id:P,filter:y,sorts:u}),E=[];(0,it.default)(S.results,D=>{let G=(0,R.default)(D,"properties");G.properties=(0,X.sortObject)(w({config:e,data:D,pathVariables:r,pageId:G.id})),!!G&&E.push(G)});let T=(0,R.default)(S,"results");T.results=E;let k=(0,R.default)(T,"data");return{info:c,content:m,items:k,images:{}}},ee=ao;var at=l(require("@jeromefitz/utils"),1),lt=l(require("lodash/omit.js"),1);var lo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:p,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s}=e,m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:{},content:{},items:{},images:{}};let h=await n({database_id:s[m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:_}})]}}),a=(h==null?void 0:h.object)==="list"&&h.results[0];if(!a)return{};let u=(0,lt.default)(a,"properties");u.properties=(0,at.sortObject)(w({config:e,data:a,pathVariables:r,pageId:u.id}));let y=await t({block_id:u.id}),S=[...await p({blocks:y.results})];return{info:u,content:S,items:{},images:{}}},te=lo;var oe=l(require("@jeromefitz/utils"),1),re=l(require("lodash/omit.js"),1),pt=l(require("lodash/size.js"),1);var po=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i})=>{var k;let{NOTION:_}=e,{meta:s}=r,m=i.toUpperCase(),[c,h]=s,a=(0,pt.default)(s)===2,u=(k=_[m])==null?void 0:k.hasChild.toUpperCase(),y=await n({database_id:_[a?_[u].routeType.toUpperCase():m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:a?h:c}})]}}),P=(y==null?void 0:y.object)==="list"&&y.results[0];if(!P)return{info:{},content:{},items:{},images:{}};let S=(0,re.default)(P,"properties");S.properties=(0,oe.sortObject)(w({config:e,data:P,pathVariables:r,pageId:S.id}));let E=await t({block_id:S.id}),T={};return a||(T=await p({config:e,reqQuery:{podcasts:S.id,databaseType:_[u].routeType.toUpperCase()}})),{info:S,content:E,items:T,images:{}}},_o=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:p,routeType:r,slug:i})=>{var k,D;let _=new Date().toISOString(),{NOTION:s}=e,{meta:m}=p,[c,h,a]=m,u=new Date(`${c||_.slice(0,4)}-${h||"01"}-${a||"01"}`),y=((D=(k=s[r.toUpperCase()])==null?void 0:k.infoType)==null?void 0:D.notion)??o.datePublished.notion,P=await n({database_id:s[r.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:I(u,"")}},{property:y,date:{before:I(u,"day")}},f(g({},x.slug),{text:{equals:i}})]}}),S=(P==null?void 0:P.object)==="list"&&P.results[0];if(!S)return{info:{},content:{},items:{},images:{}};let E=(0,re.default)(S,"properties");E.properties=(0,oe.sortObject)(w({config:e,data:S,pathVariables:p,pageId:E.id}));let T=await t({block_id:E.id});return{info:E,content:T,items:{},images:{}}},uo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i,slug:_})=>{let{NOTION:s,ROUTE_TYPES_BY_DATA_TYPES:m}=e;return s[i.toUpperCase()].hasChild?await po({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i}):m[b.LISTING_BY_DATE].includes(i.toUpperCase())?await _o({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,pathVariables:r,routeType:i,slug:_}):{info:{},content:{},items:{},images:{}}},ne=uo;var H=l(require("@jeromefitz/utils"),1),co=async({getPagesRetrieve:e,page_id:t})=>(0,H.isUndefined)(t)?[]:(await(0,H.avoidRateLimit)(),await e({page_id:t})),ie=co;var se=l(require("lodash/drop.js"),1),_t=l(require("lodash/dropRight.js"),1),ut=l(require("lodash/first.js"),1),ae=l(require("lodash/includes.js"),1),dt=l(require("lodash/isInteger.js"),1),ct=l(require("lodash/join.js"),1),yt=l(require("lodash/last.js"),1),le=l(require("lodash/size.js"),1);var yo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:p,ROUTE_META:r,ROUTE_TYPES:i}=e,_=(0,le.default)(t),s=(0,ut.default)(t),m=s.toUpperCase(),c=(0,yt.default)(t),h=_>1&&(0,ae.default)(r,m)?(0,se.default)(t):(0,se.default)((0,_t.default)(t)),a=s===c&&!(0,ae.default)(i,m)?n.PAGES.routeType:s,u=s!==c&&!(0,dt.default)(parseInt(c))?c:s,y=a===n.PAGES.routeType.toLowerCase(),P=u===s,S=!!h&&(0,le.default)(h)!==0,E=y&&s===p?"":(0,ct.default)(t,"/"),T={hasMeta:S,isPage:y,isIndex:P,meta:h,routeType:a,slug:u,url:E},k=$(T);return f(g({},T),{dataType:k})},pe=yo;var Q=l(require("@jeromefitz/utils"),1),mt=l(require("lodash/map.js"),1),ht=l(require("lodash/omit.js"),1),St=l(require("lodash/size.js"),1);var mo=[{property:o.slug.notion,direction:"ascending"}],ho=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:p}=e,{databaseType:r}=t,i=r,_=!1,s=r.toUpperCase(),m=p[s].database_id;if(!m)return[];let c={},h={},a,u;if(r==="EPISODES"){u=mo;let{podcasts:y}=t,P=[],S=[];!!y&&S.push(...y==null?void 0:y.split(",")),(0,St.default)(S)>0&&(0,mt.default)(S,E=>P.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:E}})),a={or:[...P]}}else _=!0;if(!_&&(!c||(0,Q.isObjectEmpty)(c))){await(0,Q.avoidRateLimit)();let y;a?((a==null?void 0:a.or.length)===0&&(a={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),y=await n({database_id:m,filter:a,sorts:u}),c=y,h=Ge({config:e,results:y.results,routeType:i}),c=(0,ht.default)(c,"results"),c.results=h):_=!0}return c},_e=ho;var gt=class extends Pt.Client{constructor(t){super(t);this.custom={getBlocksByIdChildren:async t=>await F(f(g({},t),{getBlocksChildrenList:this.blocks.children.list})),getDatabasesByIdQuery:async t=>await W(f(g({},t),{getDatabasesQuery:this.databases.query})),getDeepFetchAllChildren:async t=>await Y(f(g({},t),{getBlocksChildrenList:this.blocks.children.list})),getInfoType:t=>z(f(g({},t),{config:this.#e})),getPagesById:async t=>await ie(f(g({},t),{getPagesRetrieve:this.pages.retrieve})),getPathVariables:t=>pe(f(g({},t),{config:this.#e})),getQuery:async t=>await _e(f(g({},t),{config:this.#e,notionDatabasesQuery:this.databases.query}))};this.dataTypes={[b.LISTING]:async t=>await J(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.LISTING_BY_DATE]:async t=>await ee(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.SLUG]:async t=>await te(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[b.SLUG_BY_ROUTE]:async t=>await ne(f(g({},t),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};this.#e=t==null?void 0:t.config}#e};module.exports=Ct(So);0&&(module.exports={Client});
package/index.d.ts CHANGED
File without changes
package/index.js CHANGED
@@ -1 +1 @@
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};
1
+ var Re=Object.defineProperty,Ge=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var Ue=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;var X=(e,o,n)=>o in e?Re(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,g=(e,o)=>{for(var n in o||(o={}))Ue.call(o,n)&&X(e,n,o[n]);if(J)for(var n of J(o))Me.call(o,n)&&X(e,n,o[n]);return e},f=(e,o)=>Ge(e,Ae(o));import{Client as po}from"@notionhq/client";import O from"lodash/filter.js";import Ve from"lodash/map.js";var C=({key:e,notion:o,type:n})=>({key:e,notion:o,type:n}),t={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},v=[t.authors,t.datePublished,t.isIndexed,t.isPublished,t.slug,t.seoDescription,t.seoImage,t.seoImageDescription,t.title],ee=[...v],te=[...v,t.dateRecorded,t.duration,t.episode,t.mp3,t.season,t.relationEpisodes__People_Guest,t.relationEpisodes__People_Sound_Engineer,t.relationEpisodes__People_Thanks,t.relationEpisodes__Podcast,t.relationEpisodes__Venues,t.socialApple,t.socialSpotify,t.type],oe=[...v,t.dateEvent,t.relationEvents__People_Guest_Music,t.relationEvents__People_Guest,t.relationEvents__People_Host,t.relationEvents__Shows_Lineup,t.relationEvents__Shows,t.relationEvents__Venues,t.socialFacebook,t.socialWebsite,t.ticketUrl,t.rollupEvents__People_Cast,t.rollupEvents__People_Guest_Music,t.rollupEvents__People_Guest,t.rollupEvents__People_Host,t.rollupEvents__Shows_Lineup,t.rollupEvents__Shows,t.rollupEvents__Venues],re=[...v],ne=[...v,t.email,t.nameFirst,t.nameLast,t.namePreferred,t.relationPeople__Episodes_Guest,t.relationPeople__Episodes_Sound_Engineer,t.relationPeople__Episodes_Thanks,t.relationPeople__Events_Guest,t.relationPeople__Events_Guest_Music,t.relationPeople__Events_Host,t.relationPeople__Podcasts_Host,t.relationPeople__Podcasts_Sound_Engineer,t.relationPeople__Shows_Cast,t.relationPeople__Shows_Cast_Past,t.relationPeople__Shows_Director,t.relationPeople__Shows_Director_Musical,t.relationPeople__Shows_Director_Technical,t.relationPeople__Shows_Producer,t.relationPeople__Shows_Thanks,t.relationPeople__Shows_Writer],ie=[...v,t.categories,t.explicit,t.podcastAuthor,t.podcastAuthorEmail,t.relationPodcasts__People_Host,t.relationPodcasts__People_Sound_Engineer,t.socialApple,t.socialSpotify,t.type,t.relationPodcasts__Episodes],se=[...v],ae=[...v,t.relationShows__People_Cast,t.relationShows__People_Cast_Past,t.relationShows__People_Director,t.relationShows__People_Director_Musical,t.relationShows__People_Director_Technical,t.relationShows__People_Producer,t.relationShows__People_Thanks,t.relationShows__People_Writer,t.relationShows__Tags,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationShows__Events,t.relationShows__Events_Lineup,t.rollupShows__People_Cast,t.rollupShows__People_Cast_Slug,t.rollupShows__People_Cast_Past,t.rollupShows__People_Crew,t.rollupShows__People_Director,t.rollupShows__People_Director_Musical,t.rollupShows__People_Director_Technical,t.rollupShows__People_Music,t.rollupShows__People_Producer,t.rollupShows__People_Thanks,t.rollupShows__People_Writer,t.rollupShows__Tags],le=[...v,t.addressCity,t.addressLatitude,t.addressLongitude,t.addressNeighborhood,t.addressState,t.addressStreet,t.addressZipCode,t.phoneNumber,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationVenues__Episodes,t.relationVenues__Events],mo={BLOG:O(ee,{init:!0}),EPISODES:O(te,{init:!0}),EVENTS:O(oe,{init:!0}),PAGES:O(re,{init:!0}),PEOPLE:O(ne,{init:!0}),PODCASTS:O(ie,{init:!0}),SEO:O(se,{init:!0}),SHOWS:O(ae,{init:!0}),VENUES:O(le,{init:!0})},pe={BLOG:ee.map(e=>C(e)),EPISODES:te.map(e=>C(e)),EVENTS:oe.map(e=>C(e)),PAGES:re.map(e=>C(e)),PEOPLE:ne.map(e=>C(e)),PODCASTS:ie.map(e=>C(e)),SEO:se.map(e=>C(e)),SHOWS:ae.map(e=>C(e)),VENUES:le.map(e=>C(e))},_e=Ve(t,e=>C(e)),ue=new Date().toISOString(),x={dateBefore:{property:t.datePublished.notion,date:{before:ue}},dateOnOrAfter:{property:t.datePublished.notion,date:{on_or_after:ue}},published:{property:t.isPublished.notion,checkbox:{equals:!1}},slug:{property:t.slug.notion,text:{equals:""}}},He="LISTING",Qe="LISTING_BY_DATE",Fe="SLUG",We="SLUG_BY_ROUTE",Ye=[He,Qe,Fe,We],b=Object.assign({},...Ye.map(e=>({[e]:e})).flat(1));import{avoidRateLimit as ze,isUndefined as je}from"@jeromefitz/utils";var $e=async({getBlocksChildrenList:e,block_id:o})=>je(o)?[]:(await ze(),await e({block_id:o})),U=$e;var B={sorts:[{property:t.slug.notion,direction:"ascending"}]},qe=async({database_id:e,filter:o=B==null?void 0:B.filter,getDatabasesQuery:n,sorts:l=B==null?void 0:B.sorts})=>e?await n({database_id:e,sorts:l,filter:o}):[],M=qe;var de=async({getBlocksChildrenList:e,blocks:o})=>{if(o==null)return o;let n=o.filter(r=>r.has_children).map(r=>{let{id:i}=r;return{promise:e({block_id:i,page_size:100}),parent_block:r}}),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await de({blocks:i,getBlocksChildrenList:e}),n[r]){let p=n[r].parent_block;p[p.type].children=i}}return o},V=de;var Ze=({config:e,item:o,routeType:n,meta:l})=>{var c,h;let{NOTION:r}=e,i="",p=(c=o.properties)==null?void 0:c.slug,s="",m="/[...catchAll]";switch(n){case r.BLOG.routeType:case r.EVENTS.routeType:i=(h=o.properties[r[n.toUpperCase()].infoType.key])==null?void 0:h.start.slice(0,10);let[a,_,y]=i==null?void 0:i.split("-");s=`/${n}/${a}/${_}/${y}/${p}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${p}`;break;default:s=`/${n}/${p}`;break}return s=s.replace("//","/"),{as:s,date:i,href:m,slug:p}},H=Ze;import{sortObject as Ce}from"@jeromefitz/utils";import Nt from"lodash/map.js";import W from"lodash/omit.js";import ce from"date-fns/addDays/index.js";import Ke from"date-fns/addMonths/index.js";import Je from"date-fns/addYears/index.js";var Xe=(e,o)=>{switch(o){case"year":return Je(e,1).toISOString();case"month":return Ke(e,1).toISOString();case"day":return ce(e,2).toISOString()}return ce(e,-1).toISOString()},I=Xe;import et from"lodash/map.js";var tt=({config:e,data:o,pathVariables:n,pageId:l})=>{var c,h;let{NOTION:r}=e,i={};if(!(o==null?void 0:o.properties))return i;let{properties:p}=o,s="";if(n){let{meta:a,routeType:_}=n;s=_===((c=r==null?void 0:r.PODCASTS)==null?void 0:c.routeType)&&a.length>1?(h=r==null?void 0:r.EPISODES)==null?void 0:h.routeType:_}let m=s?pe[s.toUpperCase()]:_e;return et(m,a=>{let _,y=p[a.notion];i[a.key]=null,y&&(_=L[a.type](y,l),i[a.key]=_||null)}),i},w=tt;import{sortObject as ot}from"@jeromefitz/utils";import rt from"lodash/map.js";import nt from"lodash/omit.js";var it=({config:e,results:o,routeType:n})=>{let l=[];return rt(o,r=>{let i=nt(r,"properties");i.properties=ot(w({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},ye=it;var st=({isPage:e,isIndex:o,hasMeta:n})=>e?b.SLUG:o&&!n?b.LISTING:o&&n?b.LISTING_BY_DATE:n?b.SLUG_BY_ROUTE:b.SLUG,Q=st;var at=e=>(console.dir("@notion(_unsupported)"),e),R=at;var lt=e=>e.checkbox||!1,me=lt;var pt=e=>{let{type:o}=e;return e[o]},G=pt;var _t=e=>e.email||null,he=_t;import{stringToUUID as ut}from"@jeromefitz/utils";import dt from"github-slugger";import ct from"lodash/size.js";var yt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",mt=(e,o)=>yt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",ut(o)),ht=(e,o)=>{let n=new dt,l={};return ct(e.files)<=0||e.files.map(r=>{var i,p;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],m=n.slug(s);l[m]={type:r==null?void 0:r.type,url:mt(s,o)}}if((r==null?void 0:r.type)==="external"){let s=(p=r==null?void 0:r.external)==null?void 0:p.url.split("?")[0],m=n.slug(s);l[m]={type:r==null?void 0:r.type,url:s}}}),l},F=ht;import St from"github-slugger";import Pt from"lodash/map.js";var gt=e=>{let o=new St,n={};return Pt(e.multi_select,l=>{let r=l;r.slug=o.slug(r.name),n[r.id]=r}),n},Se=gt;var ft=e=>(e==null?void 0:e.number)||null,Pe=ft;import Et from"github-slugger";var wt=e=>{let o=new Et;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:p}=n,{email:s}=p;return{[o.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},ge=wt;var Tt=e=>(e==null?void 0:e.phone_number)||null,fe=Tt;import Ee from"lodash/map.js";var kt=e=>e.type==="rollup"?e.rollup.type==="array"&&Ee(e.rollup.array,o=>L[o.type](o))[0]:Ee(e.relation,o=>o.id),we=kt;var bt=e=>{var o;return(e==null?void 0:e.rich_text)?(o=e==null?void 0:e.rich_text[0])==null?void 0:o.plain_text:null},Te=bt;import It from"lodash/map.js";import Dt from"lodash/sortBy.js";var Ct=e=>{var o;return Dt(It((o=e==null?void 0:e.rollup)==null?void 0:o.array,n=>L[n.type](n)))},ke=Ct;import Ot from"github-slugger";var vt=e=>{let o=new Ot,n=e.select;return n?(n.slug=o.slug(e.select.name),{[n.id]:n}):null},be=vt;var xt=e=>{var o;return(e==null?void 0:e.title)?(o=e==null?void 0:e.title[0])==null?void 0:o.plain_text:null},Ie=xt;var Lt=e=>e.url||null,De=Lt;var Bt={checkbox:me,created_by:R,created_time:G,date:G,email:he,files:F,formula:R,image:F,last_edited_by:R,last_edited_time:G,multi_select:Se,number:Pe,people:ge,phone_number:fe,relation:we,rich_text:Te,rollup:ke,select:be,title:Ie,url:De},L=Bt;var Rt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:p}=e,s={},m=new Date().toISOString(),c=new Date("2020-01-01").toISOString(),h=p[i.toUpperCase()].page_id__seo,a=await l({page_id:h});if(!a)return{};(a==null?void 0:a.object)==="page"&&(s=W(a,"properties"),s.properties=Ce(w({config:e,data:a,pathVariables:r,pageId:s.id})));let _=p.EVENTS.routeType===i,y=p[i.toUpperCase()].infoType.notion??t.datePublished.notion,P=await o({block_id:s.id}),S=await n({database_id:p[i.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:_?m:c}}]}}),E=[];Nt(S.results,k=>{let D=k;D=W(D,"properties"),D.properties=Ce(w({config:e,data:k,pathVariables:r,pageId:k.id})),E.push(D)});let T=W(S,"results");return T.results=E,{info:s,content:P,items:T,images:{}}},Y=Rt;import{sortObject as Oe}from"@jeromefitz/utils";import Gt from"lodash/map.js";import A from"lodash/omit.js";import At from"lodash/size.js";var Ut=({config:e,pathVariables:o,routeType:n,slug:l})=>{var y,P;let{NOTION:r}=e,{meta:i}=o,[p,s,m]=i,c=At(i),h=new Date().toISOString(),a=new Date(`${p||h.slice(0,4)}-${s||"01"}-${m||"01"}`),_=((P=(y=r[n.toUpperCase()])==null?void 0:y.infoType)==null?void 0:P.notion)??t.datePublished.notion;switch(c){case 1:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"year")}}]};case 2:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"month")}}]};case 3:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"day")}}]};default:return{and:[{property:_,date:{on_or_after:I(a,"")}},{property:_,date:{before:I(a,"day")}},f(g({},x.slug),{text:{equals:l}})]}}},Mt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:p})=>{let{NOTION:s}=e,m={},c={},h=s[i.toUpperCase()].page_id__seo,a=await l({page_id:h});a.object==="page"&&(c=A(a,"properties"),c.properties=Oe(w({config:e,data:a,pathVariables:r,pageId:a.id}))),m=await o({block_id:c.id});let _=[{property:t.datePublished.notion,direction:"descending"}],y=Ut({config:e,pathVariables:r,routeType:i,slug:p}),P=s[i.toUpperCase()].database_id,S=await n({database_id:P,filter:y,sorts:_}),E=[];Gt(S.results,D=>{let N=A(D,"properties");N.properties=Oe(w({config:e,data:D,pathVariables:r,pageId:N.id})),!!N&&E.push(N)});let T=A(S,"results");T.results=E;let k=A(T,"data");return{info:c,content:m,items:k,images:{}}},z=Mt;import{sortObject as Vt}from"@jeromefitz/utils";import Ht from"lodash/omit.js";var Qt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:p})=>{let{NOTION:s}=e,m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:{},content:{},items:{},images:{}};let h=await n({database_id:s[m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:p}})]}}),a=(h==null?void 0:h.object)==="list"&&h.results[0];if(!a)return{};let _=Ht(a,"properties");_.properties=Vt(w({config:e,data:a,pathVariables:r,pageId:_.id}));let y=await o({block_id:_.id}),S=[...await l({blocks:y.results})];return{info:_,content:S,items:{},images:{}}},j=Qt;import{sortObject as ve}from"@jeromefitz/utils";import xe from"lodash/omit.js";import Ft from"lodash/size.js";var Wt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i})=>{var k;let{NOTION:p}=e,{meta:s}=r,m=i.toUpperCase(),[c,h]=s,a=Ft(s)===2,_=(k=p[m])==null?void 0:k.hasChild.toUpperCase(),y=await n({database_id:p[a?p[_].routeType.toUpperCase():m].database_id,filter:{and:[f(g({},x.slug),{text:{equals:a?h:c}})]}}),P=(y==null?void 0:y.object)==="list"&&y.results[0];if(!P)return{info:{},content:{},items:{},images:{}};let S=xe(P,"properties");S.properties=ve(w({config:e,data:P,pathVariables:r,pageId:S.id}));let E=await o({block_id:S.id}),T={};return a||(T=await l({config:e,reqQuery:{podcasts:S.id,databaseType:p[_].routeType.toUpperCase()}})),{info:S,content:E,items:T,images:{}}},Yt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,pathVariables:l,routeType:r,slug:i})=>{var k,D;let p=new Date().toISOString(),{NOTION:s}=e,{meta:m}=l,[c,h,a]=m,_=new Date(`${c||p.slice(0,4)}-${h||"01"}-${a||"01"}`),y=((D=(k=s[r.toUpperCase()])==null?void 0:k.infoType)==null?void 0:D.notion)??t.datePublished.notion,P=await n({database_id:s[r.toUpperCase()].database_id,filter:{and:[{property:y,date:{on_or_after:I(_,"")}},{property:y,date:{before:I(_,"day")}},f(g({},x.slug),{text:{equals:i}})]}}),S=(P==null?void 0:P.object)==="list"&&P.results[0];if(!S)return{info:{},content:{},items:{},images:{}};let E=xe(S,"properties");E.properties=ve(w({config:e,data:S,pathVariables:l,pageId:E.id}));let T=await o({block_id:E.id});return{info:E,content:T,items:{},images:{}}},zt=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:p})=>{let{NOTION:s,ROUTE_TYPES_BY_DATA_TYPES:m}=e;return s[i.toUpperCase()].hasChild?await Wt({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i}):m[b.LISTING_BY_DATE].includes(i.toUpperCase())?await Yt({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,pathVariables:r,routeType:i,slug:p}):{info:{},content:{},items:{},images:{}}},$=zt;import{avoidRateLimit as jt,isUndefined as $t}from"@jeromefitz/utils";var qt=async({getPagesRetrieve:e,page_id:o})=>$t(o)?[]:(await jt(),await e({page_id:o})),q=qt;import Le from"lodash/drop.js";import Zt from"lodash/dropRight.js";import Kt from"lodash/first.js";import Be from"lodash/includes.js";import Jt from"lodash/isInteger.js";import Xt from"lodash/join.js";import eo from"lodash/last.js";import Ne from"lodash/size.js";var to=({config:e,catchAll:o})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_META:r,ROUTE_TYPES:i}=e,p=Ne(o),s=Kt(o),m=s.toUpperCase(),c=eo(o),h=p>1&&Be(r,m)?Le(o):Le(Zt(o)),a=s===c&&!Be(i,m)?n.PAGES.routeType:s,_=s!==c&&!Jt(parseInt(c))?c:s,y=a===n.PAGES.routeType.toLowerCase(),P=_===s,S=!!h&&Ne(h)!==0,E=y&&s===l?"":Xt(o,"/"),T={hasMeta:S,isPage:y,isIndex:P,meta:h,routeType:a,slug:_,url:E},k=Q(T);return f(g({},T),{dataType:k})},Z=to;import{avoidRateLimit as oo,isObjectEmpty as ro}from"@jeromefitz/utils";import no from"lodash/map.js";import io from"lodash/omit.js";import so from"lodash/size.js";var ao=[{property:t.slug.notion,direction:"ascending"}],lo=async({config:e,reqQuery:o,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=o,i=r,p=!1,s=r.toUpperCase(),m=l[s].database_id;if(!m)return[];let c={},h={},a,_;if(r==="EPISODES"){_=ao;let{podcasts:y}=o,P=[],S=[];!!y&&S.push(...y==null?void 0:y.split(",")),so(S)>0&&no(S,E=>P.push({property:t.relationEpisodes__Podcast.notion,relation:{contains:E}})),a={or:[...P]}}else p=!0;if(!p&&(!c||ro(c))){await oo();let y;a?((a==null?void 0:a.or.length)===0&&(a={and:[{property:t.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),y=await n({database_id:m,filter:a,sorts:_}),c=y,h=ye({config:e,results:y.results,routeType:i}),c=io(c,"results"),c.results=h):p=!0}return c},K=lo;var _o=class extends po{constructor(o){super(o);this.custom={getBlocksByIdChildren:async o=>await U(f(g({},o),{getBlocksChildrenList:this.blocks.children.list})),getDatabasesByIdQuery:async o=>await M(f(g({},o),{getDatabasesQuery:this.databases.query})),getDeepFetchAllChildren:async o=>await V(f(g({},o),{getBlocksChildrenList:this.blocks.children.list})),getInfoType:o=>H(f(g({},o),{config:this.#e})),getPagesById:async o=>await q(f(g({},o),{getPagesRetrieve:this.pages.retrieve})),getPathVariables:o=>Z(f(g({},o),{config:this.#e})),getQuery:async o=>await K(f(g({},o),{config:this.#e,notionDatabasesQuery:this.databases.query}))};this.dataTypes={[b.LISTING]:async o=>await Y(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.LISTING_BY_DATE]:async o=>await z(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[b.SLUG]:async o=>await j(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[b.SLUG_BY_ROUTE]:async o=>await $(f(g({},o),{config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};this.#e=o==null?void 0:o.config}#e};export{_o as Client};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeromefitz/notion",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Notion: Custom Client for jeromefitzgerald.com",
5
5
  "author": {
6
6
  "name": "Jerome Fitzgerald",
@@ -26,15 +26,20 @@
26
26
  },
27
27
  "private": false,
28
28
  "scripts": {
29
- "build": "tsup-node src/*",
30
- "dev": "tsup-node src/* --watch",
29
+ "build": "tsup-node",
30
+ "dev": "tsup-node --watch",
31
31
  "---": "",
32
32
  "clean": "rm -rf .turbo && rm -rf dist",
33
33
  "clean:install": "yarn clean && rm -rf node_modules",
34
34
  "copy": "mkdir -p ./dist && ./scripts/copy.sh",
35
- "----": "",
36
- "semantic-release": "yarn copy && semantic-release",
37
- "semantic-release:mono": "yarn copy && semantic-release -e semantic-release-monorepo"
35
+ "--- ": "",
36
+ "lint:eslint": "eslint ./src --ext cjs,js,jsx,mjs,ts,tsx --max-warnings=0",
37
+ "lint:prettier": "prettier \"./src/**/*.{cjs,js,jsx,mjs,ts,tsx,json,md,mdx,css,html,yml,yaml,scss}\" --ignore-unknown --loglevel warn",
38
+ "lint": "yarn lint:prettier --check && yarn lint:eslint",
39
+ "lint:fix": "yarn lint:eslint --fix && yarn lint:prettier --write",
40
+ "--- ": "",
41
+ "semantic-release": "semantic-release",
42
+ "semantic-release:mono": "semantic-release -e semantic-release-monorepo"
38
43
  },
39
44
  "dependencies": {
40
45
  "@notionhq/client": "0.4.12",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1 +1 @@
1
- var $=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var g=s=>$(s,"__esModule",{value:!0});var I=(s,e)=>{for(var t in e)$(s,t,{get:e[t],enumerable:!0})},N=(s,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!B.call(s,r)&&(t||r!=="default")&&$(s,r,{get:()=>e[r],enumerable:!(a=f(e,r))||a.enumerable});return s};var P=(s=>(e,t)=>s&&s.get(e)||(t=N(g({}),e,1),s&&s.set(e,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var j={};I(j,{default:()=>D});var A=({config:s,item:e,routeType:t,meta:a})=>{var n,p,i,u,h;let{NOTION:r}=s,c="",l=(n=e.properties)==null?void 0:n.slug,o="",y="/[...catchAll]";switch(t){case r.BLOG.routeType:c=(i=(p=e.properties)==null?void 0:p.datePublished)==null?void 0:i.start.slice(0,10);let[b,E,O]=c==null?void 0:c.split("-");o=`/${t}/${b}/${E}/${O}/${l}`;break;case r.EVENTS.routeType:c=(h=(u=e.properties)==null?void 0:u.dateEvent)==null?void 0:h.start.slice(0,10);let[S,T,d]=c==null?void 0:c.split("-");o=`/${t}/${S}/${T}/${d}/${l}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:o=`/${a==null?void 0:a.join("/")}/${l}`;break;default:o=`/${t}/${l}`;break}return o=o.replace("//","/"),{as:o,date:c,href:y,slug:l}},D=A;module.exports=P(j);0&&(module.exports={});
1
+ var l=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var h=s=>l(s,"__esModule",{value:!0});var k=(s,e)=>{for(var r in e)l(s,r,{get:e[r],enumerable:!0})},E=(s,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of O(e))!S.call(s,t)&&(r||t!=="default")&&l(s,t,{get:()=>e[t],enumerable:!(c=f(e,t))||c.enumerable});return s};var b=(s=>(e,r)=>s&&s.get(e)||(r=E(h({}),e,1),s&&s.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var N={};k(N,{default:()=>I});var g=({config:s,item:e,routeType:r,meta:c})=>{var n,$;let{NOTION:t}=s,p="",a=(n=e.properties)==null?void 0:n.slug,o="",i="/[...catchAll]";switch(r){case t.BLOG.routeType:case t.EVENTS.routeType:p=($=e.properties[t[r.toUpperCase()].infoType.key])==null?void 0:$.start.slice(0,10);let[u,y,T]=p==null?void 0:p.split("-");o=`/${r}/${u}/${y}/${T}/${a}`;break;case t.PODCASTS.routeType:case t.EPISODES.routeType:o=`/${c==null?void 0:c.join("/")}/${a}`;break;default:o=`/${r}/${a}`;break}return o=o.replace("//","/"),{as:o,date:p,href:i,slug:a}},I=g;module.exports=b(N);0&&(module.exports={});
File without changes
@@ -1 +1 @@
1
- var d=({config:u,item:o,routeType:r,meta:a})=>{var l,$,n,p,i;let{NOTION:c}=u,e="",t=(l=o.properties)==null?void 0:l.slug,s="",h="/[...catchAll]";switch(r){case c.BLOG.routeType:e=(n=($=o.properties)==null?void 0:$.datePublished)==null?void 0:n.start.slice(0,10);let[y,b,E]=e==null?void 0:e.split("-");s=`/${r}/${y}/${b}/${E}/${t}`;break;case c.EVENTS.routeType:e=(i=(p=o.properties)==null?void 0:p.dateEvent)==null?void 0:i.start.slice(0,10);let[O,S,T]=e==null?void 0:e.split("-");s=`/${r}/${O}/${S}/${T}/${t}`;break;case c.PODCASTS.routeType:case c.EPISODES.routeType:s=`/${a==null?void 0:a.join("/")}/${t}`;break;default:s=`/${r}/${t}`;break}return s=s.replace("//","/"),{as:s,date:e,href:h,slug:t}},B=d;export{B as default};
1
+ var T=({config:n,item:p,routeType:t,meta:o})=>{var a,l;let{NOTION:s}=n,r="",c=(a=p.properties)==null?void 0:a.slug,e="",$="/[...catchAll]";switch(t){case s.BLOG.routeType:case s.EVENTS.routeType:r=(l=p.properties[s[t.toUpperCase()].infoType.key])==null?void 0:l.start.slice(0,10);let[i,u,y]=r==null?void 0:r.split("-");e=`/${t}/${i}/${u}/${y}/${c}`;break;case s.PODCASTS.routeType:case s.EPISODES.routeType:e=`/${o==null?void 0:o.join("/")}/${c}`;break;default:e=`/${t}/${c}`;break}return e=e.replace("//","/"),{as:e,date:r,href:$,slug:c}},S=T;export{S as default};