@jeromefitz/notion 1.0.0-notion.8 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +63 -2
- package/constants/index.d.ts +112 -2
- package/index.cjs +1 -1
- package/index.d.ts +1 -3
- package/index.js +1 -1
- package/package.json +13 -13
- package/queries/getBlocksByIdChildren/index.cjs +1 -1
- package/queries/getBlocksByIdChildren/index.js +1 -1
- package/queries/getNotionListing/index.cjs +1 -1
- package/queries/getNotionListing/index.js +1 -1
- package/queries/getNotionListingByDate/index.cjs +1 -1
- package/queries/getNotionListingByDate/index.js +1 -1
- package/queries/getNotionSlug/index.cjs +1 -1
- package/queries/getNotionSlug/index.js +1 -1
- package/queries/getNotionSlugByRoute/index.cjs +1 -1
- package/queries/getNotionSlugByRoute/index.js +1 -1
- package/queries/getPagesById/index.cjs +1 -1
- package/queries/getPagesById/index.js +1 -1
- package/queries/getPathVariables/index.d.ts +1 -1
- package/queries/getQuery/index.cjs +1 -1
- package/queries/getQuery/index.js +1 -1
- package/queries/index.cjs +1 -1
- package/queries/index.d.ts +1 -1
- package/queries/index.js +1 -1
- package/schema/index.d.ts +222 -1
- package/utils/dataNormalized/index.cjs +1 -1
- package/utils/dataNormalized/index.js +1 -1
- package/utils/dataNormalizedResults/index.cjs +1 -1
- package/utils/dataNormalizedResults/index.js +1 -1
- package/utils/getTypes/files.cjs +1 -1
- package/utils/getTypes/files.js +1 -1
- package/utils/getTypes/index.cjs +1 -1
- package/utils/getTypes/index.js +1 -1
- package/utils/getTypes/relation.cjs +1 -1
- package/utils/getTypes/relation.js +1 -1
- package/utils/getTypes/rollup.cjs +1 -1
- package/utils/getTypes/rollup.js +1 -1
- package/utils/index.cjs +1 -1
- package/utils/index.d.ts +0 -6
- package/utils/index.js +1 -1
- package/index-78aac290.d.ts +0 -279
- package/index-d92e2850.d.ts +0 -131
- package/utils/avoidRateLimit/index.cjs +0 -1
- package/utils/avoidRateLimit/index.d.ts +0 -3
- package/utils/avoidRateLimit/index.js +0 -1
- package/utils/dataSorted/index.cjs +0 -1
- package/utils/dataSorted/index.d.ts +0 -5
- package/utils/dataSorted/index.js +0 -1
- package/utils/isObjectEmpty/index.cjs +0 -1
- package/utils/isObjectEmpty/index.d.ts +0 -7
- package/utils/isObjectEmpty/index.js +0 -1
- package/utils/isUndefined/index.cjs +0 -1
- package/utils/isUndefined/index.d.ts +0 -3
- package/utils/isUndefined/index.js +0 -1
- package/utils/stringToUUID/index.cjs +0 -1
- package/utils/stringToUUID/index.d.ts +0 -3
- package/utils/stringToUUID/index.js +0 -1
package/LICENSE
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# `@jeromefitz/notion`
|
|
1
|
+
# 🚧️ 🚧️ 🚧️ `@jeromefitz/notion` 🚧️ 🚧️ 🚧️
|
|
2
2
|
|
|
3
3
|
Wrapper stuff for [`jeromefitzgerald.com`](https://jeromefitzgerald.com).
|
|
4
4
|
|
|
@@ -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 `
|
|
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
|
|
|
@@ -44,6 +44,67 @@ You need to pass `config` which informs the package of all the wonderful Notion
|
|
|
44
44
|
}
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
### Next
|
|
48
|
+
|
|
49
|
+
Will add an `./examples/next/...` to show this with a public facing Notion at some point.
|
|
50
|
+
|
|
51
|
+
Custom setup to get `pathVariables` from `next`:
|
|
52
|
+
|
|
53
|
+
**`[...catchAll]`**:
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
export const getStaticProps = async ({ preview = false, ...props }) => {
|
|
57
|
+
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`
|
|
62
|
+
const clear = false
|
|
63
|
+
const pathVariables = getPathVariables({ config: notionConfig, catchAll })
|
|
64
|
+
|
|
65
|
+
const data = await getCatchAll({ cache, catchAll, clear, pathVariables, preview })
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
props: { preview, ...data, ...pathVariables, ...props },
|
|
69
|
+
revalidate,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const getStaticPaths = () => {
|
|
74
|
+
return getStaticPathsCatchAll()
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**`getCatchAll.ts`**:
|
|
79
|
+
|
|
80
|
+
- Checks against `cache`
|
|
81
|
+
- Based on the `dataType` from `getPathVariables` calls `notion.dataTypes`
|
|
82
|
+
- Sets `data`
|
|
83
|
+
- Checks if should use `plaiceholder` to generate images
|
|
84
|
+
- Creates `cache` if it should
|
|
85
|
+
- Send back
|
|
86
|
+
|
|
87
|
+
**`getStaticPathsCatchAll.ts`**:
|
|
88
|
+
|
|
89
|
+
- Create paths via hard-coded values from configuration for:
|
|
90
|
+
- `PAGES__HOMEPAGE` => `index.ts`
|
|
91
|
+
- `PAGES` => Until we can get a proper query to dynamically generate
|
|
92
|
+
- Create paths to generate via `next` based off of `NOTION[#__database__#].databaseTypes`:
|
|
93
|
+
- `LISTING`
|
|
94
|
+
- `LISTING_BY_DATE`
|
|
95
|
+
- `SLUG`
|
|
96
|
+
- `SLUG_BY_ROUTE`
|
|
97
|
+
- Customizations for date based routing for:
|
|
98
|
+
- `blog` => `./blog/yyyy/mm/dd/blog-title`
|
|
99
|
+
- `events` => `./events/yyyy/mm/dd/events-title`
|
|
100
|
+
- `episodes` => `./podcasts/#__podcast-title__#/#__episode-title#`
|
|
101
|
+
|
|
102
|
+
### Cache
|
|
103
|
+
|
|
104
|
+
Currently set to `json` files within `next` build. This (currently) causes it to be generated every build.
|
|
105
|
+
|
|
106
|
+
For larger datasets this should move to a Key/Value Store that takes into account `lastEdited` from Notion for anything since the last build. (Or someting like that.)
|
|
107
|
+
|
|
47
108
|
### Why
|
|
48
109
|
|
|
49
110
|
`Next` and `Notion` are awesome.
|
package/constants/index.d.ts
CHANGED
|
@@ -1,2 +1,112 @@
|
|
|
1
|
-
import '../index
|
|
2
|
-
|
|
1
|
+
import { Property, DataTypes, DataTypesObject } from '../schema/index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @note
|
|
5
|
+
* Valid Notion Property Types mapped to Normalizer w/ init info
|
|
6
|
+
*/
|
|
7
|
+
declare const PROPERTIES: Record<string, Property>;
|
|
8
|
+
/**
|
|
9
|
+
* @note
|
|
10
|
+
* hyper-specific for the init / see (secret/create/init)
|
|
11
|
+
*
|
|
12
|
+
* 0. Create DB w/o Relations|Rollups
|
|
13
|
+
* 1. Update DB w/ Relations
|
|
14
|
+
* 2. Update DB w/ Relation Naming Preference
|
|
15
|
+
* 3. Update DB w/ Rollups
|
|
16
|
+
*/
|
|
17
|
+
declare const INIT: {
|
|
18
|
+
BLOG: Property[];
|
|
19
|
+
EPISODES: Property[];
|
|
20
|
+
EVENTS: Property[];
|
|
21
|
+
PAGES: Property[];
|
|
22
|
+
PEOPLE: Property[];
|
|
23
|
+
PODCASTS: Property[];
|
|
24
|
+
SEO: Property[];
|
|
25
|
+
SHOWS: Property[];
|
|
26
|
+
VENUES: Property[];
|
|
27
|
+
};
|
|
28
|
+
declare const LOOKUP: {
|
|
29
|
+
BLOG: {
|
|
30
|
+
key: any;
|
|
31
|
+
notion: any;
|
|
32
|
+
type: any;
|
|
33
|
+
}[];
|
|
34
|
+
EPISODES: {
|
|
35
|
+
key: any;
|
|
36
|
+
notion: any;
|
|
37
|
+
type: any;
|
|
38
|
+
}[];
|
|
39
|
+
EVENTS: {
|
|
40
|
+
key: any;
|
|
41
|
+
notion: any;
|
|
42
|
+
type: any;
|
|
43
|
+
}[];
|
|
44
|
+
PAGES: {
|
|
45
|
+
key: any;
|
|
46
|
+
notion: any;
|
|
47
|
+
type: any;
|
|
48
|
+
}[];
|
|
49
|
+
PEOPLE: {
|
|
50
|
+
key: any;
|
|
51
|
+
notion: any;
|
|
52
|
+
type: any;
|
|
53
|
+
}[];
|
|
54
|
+
PODCASTS: {
|
|
55
|
+
key: any;
|
|
56
|
+
notion: any;
|
|
57
|
+
type: any;
|
|
58
|
+
}[];
|
|
59
|
+
SEO: {
|
|
60
|
+
key: any;
|
|
61
|
+
notion: any;
|
|
62
|
+
type: any;
|
|
63
|
+
}[];
|
|
64
|
+
SHOWS: {
|
|
65
|
+
key: any;
|
|
66
|
+
notion: any;
|
|
67
|
+
type: any;
|
|
68
|
+
}[];
|
|
69
|
+
VENUES: {
|
|
70
|
+
key: any;
|
|
71
|
+
notion: any;
|
|
72
|
+
type: any;
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
declare const PROPERTIES_LOOKUP: {
|
|
76
|
+
key: any;
|
|
77
|
+
notion: any;
|
|
78
|
+
type: any;
|
|
79
|
+
}[];
|
|
80
|
+
/**
|
|
81
|
+
* @note(notion) right now we are only using `QUERIES.slug`
|
|
82
|
+
*/
|
|
83
|
+
declare const QUERIES: {
|
|
84
|
+
dateBefore: {
|
|
85
|
+
property: string;
|
|
86
|
+
date: {
|
|
87
|
+
before: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
dateOnOrAfter: {
|
|
91
|
+
property: string;
|
|
92
|
+
date: {
|
|
93
|
+
on_or_after: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
published: {
|
|
97
|
+
property: string;
|
|
98
|
+
checkbox: {
|
|
99
|
+
equals: boolean;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
slug: {
|
|
103
|
+
property: string;
|
|
104
|
+
text: {
|
|
105
|
+
equals: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
declare const getDataTypes: DataTypes[];
|
|
110
|
+
declare const DATA_TYPES: DataTypesObject;
|
|
111
|
+
|
|
112
|
+
export { DATA_TYPES, INIT, LOOKUP, PROPERTIES, PROPERTIES_LOOKUP, QUERIES, getDataTypes };
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Qt=Object.create;var q=Object.defineProperty,qt=Object.defineProperties,zt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols,Yt=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var Ce=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&Ce(e,n,t[n]);if(Ie)for(var n of Ie(t))Zt.call(t,n)&&Ce(e,n,t[n]);return e},k=(e,t)=>qt(e,$t(t)),ve=e=>q(e,"__esModule",{value:!0});var xe=(e,t)=>{for(var n in t)q(e,n,{get:t[n],enumerable:!0})},Oe=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jt(t))!De.call(e,r)&&(n||r!=="default")&&q(e,r,{get:()=>t[r],enumerable:!(l=zt(t,r))||l.enumerable});return e},p=(e,t)=>Oe(ve(q(e!=null?Qt(Yt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Kt=(e=>(t,n)=>e&&e.get(t)||(n=Oe(ve({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Ne=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var G=(e,t,n)=>(Ne(e,t,"read from private field"),n?n.call(e):t.get(e)),Le=(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)},Ge=(e,t,n,l)=>(Ne(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);var $o={};xe($o,{Client:()=>Wt,constants:()=>Y});var Ht=p(require("@notionhq/client"),1);var Y={};xe(Y,{DATA_TYPES:()=>A,INIT:()=>Jt,LOOKUP:()=>ie,PROPERTIES:()=>o,PROPERTIES_LOOKUP:()=>se,QUERIES:()=>B,getDataTypes:()=>ze});var O=p(require("lodash/filter.js"),1),Be=p(require("lodash/map.js"),1),N=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},L=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Ae=[...L],Ue=[...L,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],Ve=[...L,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],Me=[...L],Re=[...L,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],He=[...L,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],We=[...L],Fe=[...L,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],Qe=[...L,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],Jt={BLOG:(0,O.default)(Ae,{init:!0}),EPISODES:(0,O.default)(Ue,{init:!0}),EVENTS:(0,O.default)(Ve,{init:!0}),PAGES:(0,O.default)(Me,{init:!0}),PEOPLE:(0,O.default)(Re,{init:!0}),PODCASTS:(0,O.default)(He,{init:!0}),SEO:(0,O.default)(We,{init:!0}),SHOWS:(0,O.default)(Fe,{init:!0}),VENUES:(0,O.default)(Qe,{init:!0})},ie={BLOG:Ae.map(e=>N(e)),EPISODES:Ue.map(e=>N(e)),EVENTS:Ve.map(e=>N(e)),PAGES:Me.map(e=>N(e)),PEOPLE:Re.map(e=>N(e)),PODCASTS:He.map(e=>N(e)),SEO:We.map(e=>N(e)),SHOWS:Fe.map(e=>N(e)),VENUES:Qe.map(e=>N(e))},se=(0,Be.default)(o,e=>N(e)),qe=new Date().toISOString(),B={dateBefore:{property:o.datePublished.notion,date:{before:qe}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:qe}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Xt="LISTING",eo="LISTING_BY_DATE",to="SLUG",oo="SLUG_BY_ROUTE",ze=[Xt,eo,to,oo],A=Object.assign({},...ze.map(e=>({[e]:e})).flat(1));var ae=p(require("date-fns/addDays/index.js"),1),$e=p(require("date-fns/addMonths/index.js"),1),je=p(require("date-fns/addYears/index.js"),1),ro=(e,t)=>{switch(t){case"year":return(0,je.default)(e,1).toISOString();case"month":return(0,$e.default)(e,1).toISOString();case"day":return(0,ae.default)(e,2).toISOString()}return(0,ae.default)(e,-1).toISOString()},C=ro;var no=250;async function io(){await so()}function so(e=no){return new Promise(t=>setTimeout(t,e))}var V=io;var Ye=p(require("lodash/map.js"),1);var ao=({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?ie[s.toUpperCase()]:se;return(0,Ye.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=ao;var Ze=p(require("lodash/map.js"),1),Ke=p(require("lodash/omit.js"),1);var lo=({config:e,results:t,routeType:n})=>{let l=[];return(0,Ze.default)(t,r=>{let i=(0,Ke.default)(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Je=lo;var Xe=p(require("lodash/fromPairs.js"),1),et=p(require("lodash/sortBy.js"),1),tt=p(require("lodash/toPairs.js"),1),po=e=>(0,Xe.default)((0,et.default)((0,tt.default)(e))),D=po;var ot=p(require("lodash/filter.js"),1),Z=p(require("lodash/map.js"),1),_o=(e,t)=>{switch(t){case"info":let n=[];return(0,Z.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,ot.default)(e,{object:"block",type:"image"});case"items":let l=[];return(0,Z.default)(e,r=>{var i;(0,Z.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=_o;var rt=p(require("github-slugger"),1),K=p(require("lodash/map.js"),1),J=p(require("plaiceholder"),1);var uo=async({data:e,pathVariables:t})=>{var c,h,f,u,T,E,g;let n=new rt.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,J.getPlaiceholder)(w),x=n.slug(w);return{base64:S,id:x,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 U,H;if(!_)return null;let{type:w}=_,S=_[w],P=!!_&&!!((U=S==null?void 0:S.external)==null?void 0:U.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:x,img:F}=await(0,J.getPlaiceholder)(P),R=n.slug(P);return{base64:x,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 x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:F,img:R}=await(0,J.getPlaiceholder)(x),U=n.slug(x);return{base64:F,id:U,img:R,url:x}}),S=await Promise.all(w);!!S&&S[0]&&(0,K.default)(S,P=>l[P.id]=P)}return!!a&&a[0]&&(0,K.default)(a,_=>l[_.id]=_),!!m&&m[0]&&(0,K.default)(m,_=>l[_.id]=_),l},z=uo;var co=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),X=co;var yo=e=>e.checkbox||!1,nt=yo;var mo=e=>{let{type:t}=e;return e[t]},ee=mo;var ho=e=>e.email||null,it=ho;var at=p(require("github-slugger"),1),lt=p(require("lodash/size.js"),1);var So=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),st=So;var Po="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",fo=(e,t)=>Po.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",st(t)),Eo=(e,t)=>{let n=new at.default,l={};return(0,lt.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:fo(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},le=Eo;var pt=p(require("github-slugger"),1),_t=p(require("lodash/map.js"),1),go=e=>{let t=new pt.default,n={};return(0,_t.default)(e.multi_select,l=>{let r=l;r.slug=t.slug(r.name),n[r.id]=r}),n},ut=go;var wo=e=>(e==null?void 0:e.number)||null,dt=wo;var ct=p(require("github-slugger"),1),bo=e=>{let t=new ct.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]},yt=bo;var To=e=>(e==null?void 0:e.phone_number)||null,mt=To;var pe=p(require("lodash/map.js"),1);var ko=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,pe.default)(e.rollup.array,t=>M[t.type](t))[0]:(0,pe.default)(e.relation,t=>t.id),ht=ko;var Io=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},St=Io;var Pt=p(require("lodash/map.js"),1),ft=p(require("lodash/sortBy.js"),1);var Do=e=>{var t;return(0,ft.default)((0,Pt.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>M[n.type](n)))},Et=Do;var gt=p(require("github-slugger"),1),Co=e=>{let t=new gt.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},wt=Co;var vo=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},bt=vo;var xo=e=>e.url||null,Tt=xo;var Oo={checkbox:nt,created_by:X,created_time:ee,date:ee,email:it,files:le,formula:X,image:le,last_edited_by:X,last_edited_time:ee,multi_select:ut,number:dt,people:yt,phone_number:mt,relation:ht,rich_text:St,rollup:Et,select:wt,title:bt,url:Tt},M=Oo;var No=e=>Object.entries(e).length===0&&e.constructor===Object,_e=No;var Lo=e=>e===void 0&&typeof e=="undefined",$=Lo;var Go=async(e,{block_id:t})=>$(t)?[]:(await V(),await e({block_id:t})),ue=Go;var kt={sorts:[{property:o.slug.notion,direction:"ascending"}]},Bo=async(e,{database_id:t,sorts:n=kt.sorts,filter:l=kt.filter})=>t?await e({database_id:t,sorts:n,filter:l}):[],de=Bo;var It=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 It(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},ce=It;var Ao=({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}},ye=Ao;var Dt=p(require("lodash/map.js"),1),te=p(require("lodash/omit.js"),1);var Uo=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,te.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,Dt.default)(T.results,S=>{let P=S;P=(0,te.default)(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=(0,te.default)(T,"results");g.results=E,m=g;let _={info:y,content:s,items:m,images:{}},w=_?await z({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},me=Uo;var Ct=p(require("lodash/map.js"),1),j=p(require("lodash/omit.js"),1),vt=p(require("lodash/size.js"),1);var Vo=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,j.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,vt.default)(y),[g,_,w]=y,S=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,x=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after: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({},B.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:x}),U=[];(0,Ct.default)(R.results,ne=>{let Q=ne;Q=(0,j.default)(Q,"properties"),Q.properties=D(I({config:e,data:ne,pathVariables:r,pageId:ne.id})),!!Q&&U.push(Q)});let H=(0,j.default)(R,"results");H.results=U,h=H,h=(0,j.default)(H,"data");let re={info:c,content:m,items:h,images:{}},Ft={};return re=k(b({},re),{images:Ft}),re},he=Vo;var xt=p(require("lodash/filter.js"),1),Ot=p(require("lodash/omit.js"),1);var Mo=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({},B.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};m=(0,Ot.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,xt.default)(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},_=g?await z({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},Se=Mo;var Pe=p(require("lodash/omit.js"),1),Nt=p(require("lodash/size.js"),1);var Ro=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,Nt.default)(y)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},B.slug),{text:{equals:_?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=(0,Pe.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({},B.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=(0,Pe.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},fe=Ro;var Ho=async(e,{page_id:t})=>$(t)?[]:(await V(),await e({page_id:t})),Ee=Ho;var ge=p(require("lodash/drop.js"),1),Lt=p(require("lodash/dropRight.js"),1),Gt=p(require("lodash/first.js"),1),we=p(require("lodash/includes.js"),1),Bt=p(require("lodash/isInteger.js"),1),At=p(require("lodash/join.js"),1),Ut=p(require("lodash/last.js"),1),be=p(require("lodash/size.js"),1);var Wo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=(0,be.default)(t),a=(0,Gt.default)(t),s=(0,Ut.default)(t),y=i>1&&(0,we.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,ge.default)(t):(0,ge.default)((0,Lt.default)(t)),m=a===s&&!(0,we.default)(r,a)?"pages":a,c=a!==s&&!(0,Bt.default)(parseInt(s))?s:a,h=m==="pages",f=c===a,u=!!y&&(0,be.default)(y)!==0,T=h&&a===l?"":(0,At.default)(t,"/"),E=A.SLUG;return h?E=A.SLUG:f&&!u?E=A.LISTING:f&&u?E=A.LISTING_BY_DATE:u?E=A.SLUG_BY_ROUTE:E=A.SLUG,{dataType:E,hasMeta:u,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},Te=Wo;var Vt=p(require("lodash/map.js"),1),Mt=p(require("lodash/omit.js"),1),Rt=p(require("lodash/size.js"),1);var Fo={ASCENDING:"ascending",DESCENDING:"descending"},Qo=[{property:o.slug.notion,direction:Fo.ASCENDING}],qo=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=Qo;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,Rt.default)(E)>0&&(0,Vt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||_e(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=Je({config:e,results:u.results,routeType:i}),m=(0,Mt.default)(m,"results"),m.results=c):a=!0}return m},ke=qo;var{DATA_TYPES:oe}=Y,v,Wt=class extends Ht.Client{constructor(t){super(t);Le(this,v,void 0);this.custom={getBlocksByIdChildren:async t=>await ue(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await de(this.databases.query,t),getDeepFetchAllChildren:async t=>await ce(this.blocks.children.list,b({},t)),getInfoType:t=>ye(k(b({},t),{config:G(this,v)})),getPagesById:async t=>await Ee(this.pages.retrieve,b({},t)),getPathVariables:t=>Te(k(b({},t),{config:G(this,v)})),getQuery:async t=>await ke(k(b({},t),{config:G(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[oe.LISTING]:async t=>await me(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[oe.LISTING_BY_DATE]:async t=>await he(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[oe.SLUG]:async t=>await Se(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[oe.SLUG_BY_ROUTE]:async t=>await fe(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};Ge(this,v,t==null?void 0:t.config)}};v=new WeakMap;module.exports=Kt($o);0&&(module.exports={Client,constants});
|
|
1
|
+
var Ht=Object.create;var F=Object.defineProperty,Wt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptor,Qt=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,zt=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Ie=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))ke.call(t,n)&&Ie(e,n,t[n]);if(Te)for(var n of Te(t))$t.call(t,n)&&Ie(e,n,t[n]);return e},k=(e,t)=>Wt(e,Qt(t)),De=e=>F(e,"__esModule",{value:!0});var Yt=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jt(t))!ke.call(e,r)&&(n||r!=="default")&&F(e,r,{get:()=>t[r],enumerable:!(p=Ft(t,r))||p.enumerable});return e},l=(e,t)=>Ce(De(F(e!=null?Ht(zt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),qt=(e=>(t,n)=>e&&e.get(t)||(n=Ce(De({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var ve=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var L=(e,t,n)=>(ve(e,t,"read from private field"),n?n.call(e):t.get(e)),xe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Oe=(e,t,n,p)=>(ve(e,t,"write to private field"),p?p.call(e,n):t.set(e,n),n);var Uo={};Yt(Uo,{Client:()=>Mt});var Vt=l(require("@notionhq/client"),1);var O=l(require("lodash/filter.js"),1),Ne=l(require("lodash/map.js"),1),N=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Ge=[...G],Le=[...G,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],Be=[...G,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],Ae=[...G],Ue=[...G,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],Ve=[...G,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Me=[...G],Re=[...G,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],He=[...G,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],Mo={BLOG:(0,O.default)(Ge,{init:!0}),EPISODES:(0,O.default)(Le,{init:!0}),EVENTS:(0,O.default)(Be,{init:!0}),PAGES:(0,O.default)(Ae,{init:!0}),PEOPLE:(0,O.default)(Ue,{init:!0}),PODCASTS:(0,O.default)(Ve,{init:!0}),SEO:(0,O.default)(Me,{init:!0}),SHOWS:(0,O.default)(Re,{init:!0}),VENUES:(0,O.default)(He,{init:!0})},We={BLOG:Ge.map(e=>N(e)),EPISODES:Le.map(e=>N(e)),EVENTS:Be.map(e=>N(e)),PAGES:Ae.map(e=>N(e)),PEOPLE:Ue.map(e=>N(e)),PODCASTS:Ve.map(e=>N(e)),SEO:Me.map(e=>N(e)),SHOWS:Re.map(e=>N(e)),VENUES:He.map(e=>N(e))},Fe=(0,Ne.default)(o,e=>N(e)),Qe=new Date().toISOString(),A={dateBefore:{property:o.datePublished.notion,date:{before:Qe}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:Qe}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Zt="LISTING",Kt="LISTING_BY_DATE",Jt="SLUG",Xt="SLUG_BY_ROUTE",eo=[Zt,Kt,Jt,Xt],C=Object.assign({},...eo.map(e=>({[e]:e})).flat(1));var z=l(require("@jeromefitz/utils"),1),to=async(e,{block_id:t})=>(0,z.isUndefined)(t)?[]:(await(0,z.avoidRateLimit)(),await e({block_id:t})),re=to;var je={sorts:[{property:o.slug.notion,direction:"ascending"}]},oo=async(e,{database_id:t,sorts:n=je.sorts,filter:p=je.filter})=>t?await e({database_id:t,sorts:n,filter:p}):[],ne=oo;var ze=async(e,{blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),p=await Promise.all(n.map(r=>r.promise));for(let r=0;r<p.length;r++){let i=p[r].results;if(await ze(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},ie=ze;var ro=({config:e,item:t,routeType:n,meta:p})=>{var y,d,m,f,u;let{NOTION:r}=e,i="",a=(y=t.properties)==null?void 0:y.slug,s="",c="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(m=(d=t.properties)==null?void 0:d.datePublished)==null?void 0:m.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(u=(f=t.properties)==null?void 0:f.dateEvent)==null?void 0:u.start.slice(0,10);let[_,w,h]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${h}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${p==null?void 0:p.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:c,slug:a}},se=ro;var _e=l(require("@jeromefitz/utils"),1),bt=l(require("lodash/map.js"),1),J=l(require("lodash/omit.js"),1);var ae=l(require("date-fns/addDays/index.js"),1),$e=l(require("date-fns/addMonths/index.js"),1),Ye=l(require("date-fns/addYears/index.js"),1),no=(e,t)=>{switch(t){case"year":return(0,Ye.default)(e,1).toISOString();case"month":return(0,$e.default)(e,1).toISOString();case"day":return(0,ae.default)(e,2).toISOString()}return(0,ae.default)(e,-1).toISOString()},D=no;var qe=l(require("lodash/map.js"),1);var io=({config:e,data:t,pathVariables:n,pageId:p})=>{var y,d;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:m,routeType:f}=n;s=f===((y=r==null?void 0:r.PODCASTS)==null?void 0:y.routeType)&&m.length>1?(d=r==null?void 0:r.EPISODES)==null?void 0:d.routeType:f}let c=s?We[s.toUpperCase()]:Fe;return(0,qe.default)(c,m=>{let f,u=a[m.notion];i[m.key]=null,u&&(f=U[m.type](u,p),i[m.key]=f||null)}),i},I=io;var Ze=l(require("@jeromefitz/utils"),1),Ke=l(require("lodash/map.js"),1),Je=l(require("lodash/omit.js"),1);var so=({config:e,results:t,routeType:n})=>{let p=[];return(0,Ke.default)(t,r=>{let i=(0,Je.default)(r,"properties");i.properties=(0,Ze.sortObject)(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),p.push(i)}),p},Xe=so;var et=l(require("lodash/filter.js"),1),$=l(require("lodash/map.js"),1),ao=(e,t)=>{switch(t){case"info":let n=[];return(0,$.default)(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&(0,et.default)(e,{object:"block",type:"image"});case"items":let p=[];return(0,$.default)(e,r=>{var i;(0,$.default)((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&p.push(a==null?void 0:a.url))}),p;default:return[]}},R=ao;var tt=l(require("github-slugger"),1),Y=l(require("lodash/map.js"),1),q=l(require("plaiceholder"),1);var lo=async({data:e,pathVariables:t})=>{var d,m,f,u,T,E,g;let n=new tt.default,p={},r=((d=e.info)==null?void 0:d.object)==="page"?R((m=e.info)==null?void 0:m.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&R((T=(u=e.info)==null?void 0:u.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async _=>{if(!_)return null;let w=!!_&&!!(_==null?void 0:_.url)?_==null?void 0:_.url:_;if(!w)return null;let{base64:h,img:P}=await(0,q.getPlaiceholder)(w),x=n.slug(w);return{base64:h,id:x,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&R(e==null?void 0:e.content,"content"),c=!!s&&s.map(async _=>{var B,M;if(!_)return null;let{type:w}=_,h=_[w],P=!!_&&!!((B=h==null?void 0:h.external)==null?void 0:B.url)?(M=h==null?void 0:h.external)==null?void 0:M.url:null;if(!P)return null;let{base64:x,img:H}=await(0,q.getPlaiceholder)(P),V=n.slug(P);return{base64:x,id:V,img:H,url:P}}),y=c?await Promise.all(c):[];if(e.items){let _=e.items.object==="page"?R((E=e.items)==null?void 0:E.data,"items"):R((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:H,img:V}=await(0,q.getPlaiceholder)(x),B=n.slug(x);return{base64:H,id:B,img:V,url:x}}),h=await Promise.all(w);!!h&&h[0]&&(0,Y.default)(h,P=>p[P.id]=P)}return!!a&&a[0]&&(0,Y.default)(a,_=>p[_.id]=_),!!y&&y[0]&&(0,Y.default)(y,_=>p[_.id]=_),p},Q=lo;var po=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),Z=po;var _o=e=>e.checkbox||!1,ot=_o;var uo=e=>{let{type:t}=e;return e[t]},K=uo;var co=e=>e.email||null,rt=co;var nt=l(require("@jeromefitz/utils"),1),it=l(require("github-slugger"),1),st=l(require("lodash/size.js"),1),yo="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",mo=(e,t)=>yo.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,nt.stringToUUID)(t)),ho=(e,t)=>{let n=new it.default,p={};return(0,st.default)(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],c=n.slug(s);p[c]={type:r==null?void 0:r.type,url:mo(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],c=n.slug(s);p[c]={type:r==null?void 0:r.type,url:s}}}),p},le=ho;var at=l(require("github-slugger"),1),lt=l(require("lodash/map.js"),1),So=e=>{let t=new at.default,n={};return(0,lt.default)(e.multi_select,p=>{let r=p;r.slug=t.slug(r.name),n[r.id]=r}),n},pt=So;var Po=e=>(e==null?void 0:e.number)||null,_t=Po;var ut=l(require("github-slugger"),1),fo=e=>{let t=new ut.default;return e.people.map(n=>{let{avatar_url:p,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:p,email:s,id:r,name:i}}})[0]},dt=fo;var Eo=e=>(e==null?void 0:e.phone_number)||null,ct=Eo;var pe=l(require("lodash/map.js"),1);var go=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,pe.default)(e.rollup.array,t=>U[t.type](t))[0]:(0,pe.default)(e.relation,t=>t.id),yt=go;var wo=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},mt=wo;var ht=l(require("lodash/map.js"),1),St=l(require("lodash/sortBy.js"),1);var bo=e=>{var t;return(0,St.default)((0,ht.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>U[n.type](n)))},Pt=bo;var ft=l(require("github-slugger"),1),To=e=>{let t=new ft.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Et=To;var ko=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},gt=ko;var Io=e=>e.url||null,wt=Io;var Do={checkbox:ot,created_by:Z,created_time:K,date:K,email:rt,files:le,formula:Z,image:le,last_edited_by:Z,last_edited_time:K,multi_select:pt,number:_t,people:dt,phone_number:ct,relation:yt,rich_text:mt,rollup:Pt,select:Et,title:gt,url:wt},U=Do;var Co=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},c={},y={},d=new Date().toISOString(),m=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await p({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(c=(0,J.default)(u,"properties"),c.properties=(0,_e.sortObject)(I({config:e,data:u,pathVariables:r,pageId:c.id}))),s=await t({block_id:c.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?d:m}}]}}),E=[];(0,bt.default)(T.results,h=>{let P=h;P=(0,J.default)(P,"properties"),P.properties=(0,_e.sortObject)(I({config:e,data:h,pathVariables:r,pageId:h.id})),E.push(P)});let g=(0,J.default)(T,"results");g.results=E,y=g;let _={info:c,content:s,items:y,images:{}},w=_?await Q({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},ue=Co;var de=l(require("@jeromefitz/utils"),1),Tt=l(require("lodash/map.js"),1),j=l(require("lodash/omit.js"),1),kt=l(require("lodash/size.js"),1);var vo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:c}=r,y={},d={},m={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await p({page_id:u});T.object==="page"&&(d=(0,j.default)(T,"properties"),d.properties=(0,de.sortObject)(I({config:e,data:T,pathVariables:r,pageId:d.id}))),y=await t({block_id:d.id});let E=(0,kt.default)(c),[g,_,w]=c,h=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,x=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"day")}},k(b({},A.slug),{text:{equals:a}})]};break}let H=s[i.toUpperCase()].database_id,V=await n({database_id:H,filter:P,sorts:x}),B=[];(0,Tt.default)(V.results,oe=>{let W=oe;W=(0,j.default)(W,"properties"),W.properties=(0,de.sortObject)(I({config:e,data:oe,pathVariables:r,pageId:oe.id})),!!W&&B.push(W)});let M=(0,j.default)(V,"results");M.results=B,m=M,m=(0,j.default)(M,"data");let te={info:d,content:y,items:m,images:{}},Rt={};return te=k(b({},te),{images:Rt}),te},ce=vo;var It=l(require("@jeromefitz/utils"),1),Dt=l(require("lodash/filter.js"),1),Ct=l(require("lodash/omit.js"),1);var xo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,c={},y={},d={},m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:y,content:c,items:d,images:{}};let u=await n({database_id:s[m].database_id,filter:{and:[k(b({},A.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};y=(0,Ct.default)(T,"properties"),y.properties=(0,It.sortObject)(I({config:e,data:T,pathVariables:r,pageId:y.id})),c=await t({block_id:y.id}),c=[...await p({blocks:c.results})],d&&(d.results=(0,Dt.default)(d.results,{properties:{isPublished:!0}}));let g={info:y,content:c,items:d,images:{}},_=g?await Q({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},ye=xo;var me=l(require("@jeromefitz/utils"),1),he=l(require("lodash/omit.js"),1),vt=l(require("lodash/size.js"),1);var Oo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:c}=r,y={},d={},m={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=c,_=(0,vt.default)(c)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},A.slug),{text:{equals:_?g:E}})]}}),h=(w==null?void 0:w.object)==="list"&&w.results[0];if(!h)return{};d=(0,he.default)(h,"properties"),d.properties=(0,me.sortObject)(I({config:e,data:h,pathVariables:r,pageId:d.id})),y=await t({block_id:d.id}),_||i===s.PODCASTS.routeType&&(m=await p({config:e,reqQuery:{podcasts:d.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=c,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),h=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(w,"day")}},k(b({},A.slug),{text:{equals:a}})]}}),P=(h==null?void 0:h.object)==="list"&&h.results[0];P&&(d=(0,he.default)(P,"properties"),d.properties=(0,me.sortObject)(I({config:e,data:P,pathVariables:r,pageId:d.id})),y=await t({block_id:d.id}))}let u={info:d,content:y,items:m,images:{}},T={};return u=k(b({},u),{images:T}),u},Se=Oo;var X=l(require("@jeromefitz/utils"),1),No=async(e,{page_id:t})=>(0,X.isUndefined)(t)?[]:(await(0,X.avoidRateLimit)(),await e({page_id:t})),Pe=No;var fe=l(require("lodash/drop.js"),1),xt=l(require("lodash/dropRight.js"),1),Ot=l(require("lodash/first.js"),1),Ee=l(require("lodash/includes.js"),1),Nt=l(require("lodash/isInteger.js"),1),Gt=l(require("lodash/join.js"),1),Lt=l(require("lodash/last.js"),1),ge=l(require("lodash/size.js"),1);var Go=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:p,ROUTE_TYPES:r}=e,i=(0,ge.default)(t),a=(0,Ot.default)(t),s=(0,Lt.default)(t),c=i>1&&(0,Ee.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,fe.default)(t):(0,fe.default)((0,xt.default)(t)),y=a===s&&!(0,Ee.default)(r,a)?"pages":a,d=a!==s&&!(0,Nt.default)(parseInt(s))?s:a,m=y==="pages",f=d===a,u=!!c&&(0,ge.default)(c)!==0,T=m&&a===p?"":(0,Gt.default)(t,"/"),E=C.SLUG;return m?E=C.SLUG:f&&!u?E=C.LISTING:f&&u?E=C.LISTING_BY_DATE:u?E=C.SLUG_BY_ROUTE:E=C.SLUG,{dataType:E,hasMeta:u,isPage:m,isIndex:f,meta:c,routeType:y,slug:d,url:T}},we=Go;var ee=l(require("@jeromefitz/utils"),1),Bt=l(require("lodash/map.js"),1),At=l(require("lodash/omit.js"),1),Ut=l(require("lodash/size.js"),1);var Lo={ASCENDING:"ascending",DESCENDING:"descending"},Bo=[{property:o.slug.notion,direction:Lo.ASCENDING}],Ao=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:p}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),c=p[s].database_id;if(!c)return[];let y={},d={},m,f;if(r==="EPISODES"){f=Bo;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,Ut.default)(E)>0&&(0,Bt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),m={or:[...T]}}else a=!0;if(!a&&(!y||(0,ee.isObjectEmpty)(y))){await(0,ee.avoidRateLimit)();let u;m?((m==null?void 0:m.or.length)===0&&(m={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:c,filter:m,sorts:f}),y=u,d=Xe({config:e,results:u.results,routeType:i}),y=(0,At.default)(y,"results"),y.results=d):a=!0}return y},be=Ao;var v,Mt=class extends Vt.Client{constructor(t){super(t);xe(this,v,void 0);this.custom={getBlocksByIdChildren:async t=>await re(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await ne(this.databases.query,t),getDeepFetchAllChildren:async t=>await ie(this.blocks.children.list,b({},t)),getInfoType:t=>se(k(b({},t),{config:L(this,v)})),getPagesById:async t=>await Pe(this.pages.retrieve,b({},t)),getPathVariables:t=>we(k(b({},t),{config:L(this,v)})),getQuery:async t=>await be(k(b({},t),{config:L(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[C.LISTING]:async t=>await ue(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.LISTING_BY_DATE]:async t=>await ce(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.SLUG]:async t=>await ye(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[C.SLUG_BY_ROUTE]:async t=>await Se(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};Oe(this,v,t==null?void 0:t.config)}};v=new WeakMap;module.exports=qt(Uo);0&&(module.exports={Client});
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import { DataTypes } from './schema/index';
|
|
1
2
|
import { Client as Client$1 } from '@notionhq/client';
|
|
2
|
-
export { i as constants } from './index-d92e2850';
|
|
3
|
-
import { D as DataTypes } from './index-78aac290';
|
|
4
|
-
export { i as TYPES } from './index-78aac290';
|
|
5
3
|
|
|
6
4
|
declare class Client extends Client$1 {
|
|
7
5
|
#private;
|