@jeromefitz/notion 1.0.0 → 2.0.2

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