@jeromefitz/notion 5.1.13-canary.3 → 6.0.0

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 (71) hide show
  1. package/constants/index.d.mts +1 -1
  2. package/constants/index.d.mts.map +1 -1
  3. package/constants/index.mjs +2 -1
  4. package/constants/index.mjs.map +1 -0
  5. package/getTypes-Df5GL8wS.mjs +2 -0
  6. package/getTypes-Df5GL8wS.mjs.map +1 -0
  7. package/{index-BnQkUs70.d.mts → index-CvmUSReI.d.mts} +1 -1
  8. package/{index-BnQkUs70.d.mts.map → index-CvmUSReI.d.mts.map} +1 -1
  9. package/index.d.mts +1 -1
  10. package/index.mjs +1 -1
  11. package/index.mjs.map +1 -1
  12. package/package.json +3 -6
  13. package/queries/getDatabasesByIdQuery/index.d.mts +1 -1
  14. package/queries/getDatabasesByIdQuery/index.mjs +1 -1
  15. package/queries/getDatabasesByIdQuery/index.mjs.map +1 -1
  16. package/queries/getNotionListing/index.d.mts.map +1 -1
  17. package/queries/getNotionListing/index.mjs +1 -1
  18. package/queries/getNotionListing/index.mjs.map +1 -1
  19. package/queries/getNotionListingByDate/index.d.mts.map +1 -1
  20. package/queries/getNotionListingByDate/index.mjs +1 -1
  21. package/queries/getNotionListingByDate/index.mjs.map +1 -1
  22. package/queries/getNotionSlug/index.d.mts.map +1 -1
  23. package/queries/getNotionSlug/index.mjs +1 -1
  24. package/queries/getNotionSlug/index.mjs.map +1 -1
  25. package/queries/getNotionSlugByRoute/index.d.mts.map +1 -1
  26. package/queries/getNotionSlugByRoute/index.mjs +1 -1
  27. package/queries/getNotionSlugByRoute/index.mjs.map +1 -1
  28. package/queries/getPathVariables/index.d.mts +1 -1
  29. package/queries/getPathVariables/index.d.mts.map +1 -1
  30. package/queries/getPathVariables/index.mjs +2 -1
  31. package/queries/getPathVariables/index.mjs.map +1 -0
  32. package/queries/getQuery/index.d.mts.map +1 -1
  33. package/queries/getQuery/index.mjs +1 -1
  34. package/queries/getQuery/index.mjs.map +1 -1
  35. package/queries/index.mjs +1 -1
  36. package/schema/index.d.mts +1 -1
  37. package/utils/dataNormalized/index.mjs +1 -1
  38. package/utils/dataNormalizedResults/index.d.mts.map +1 -1
  39. package/utils/dataNormalizedResults/index.mjs +1 -1
  40. package/utils/getDataType/index.d.mts +1 -1
  41. package/utils/getDataType/index.mjs +1 -1
  42. package/utils/getDataType/index.mjs.map +1 -1
  43. package/utils/getTitle/index.mjs +2 -1
  44. package/utils/getTitle/index.mjs.map +1 -0
  45. package/utils/getTypes/files.mjs +2 -1
  46. package/utils/getTypes/files.mjs.map +1 -0
  47. package/utils/getTypes/index.mjs +1 -1
  48. package/utils/getTypes/multi_select.mjs +1 -1
  49. package/utils/getTypes/multi_select.mjs.map +1 -1
  50. package/utils/getTypes/relation.mjs +1 -1
  51. package/utils/getTypes/rollup.d.mts.map +1 -1
  52. package/utils/getTypes/rollup.mjs +1 -1
  53. package/utils/index.mjs +1 -1
  54. package/utils-bTlwvfkE.mjs +2 -0
  55. package/utils-bTlwvfkE.mjs.map +1 -0
  56. package/_baseProperty-D8FHbIgx.mjs +0 -2
  57. package/_baseProperty-D8FHbIgx.mjs.map +0 -1
  58. package/constants-C5KahlYP.mjs +0 -2
  59. package/constants-C5KahlYP.mjs.map +0 -1
  60. package/files-CS-BvFuw.mjs +0 -2
  61. package/files-CS-BvFuw.mjs.map +0 -1
  62. package/getPathVariables-ffMiRvxv.mjs +0 -2
  63. package/getPathVariables-ffMiRvxv.mjs.map +0 -1
  64. package/getTitle-PyFbOk6t.mjs +0 -2
  65. package/getTitle-PyFbOk6t.mjs.map +0 -1
  66. package/getTypes-B309tjVR.mjs +0 -2
  67. package/getTypes-B309tjVR.mjs.map +0 -1
  68. package/map-C4ZbQ-N0.mjs +0 -2
  69. package/map-C4ZbQ-N0.mjs.map +0 -1
  70. package/utils-DGZbVKmT.mjs +0 -2
  71. package/utils-DGZbVKmT.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as DataTypesObject, r as DataTypes, x as Property } from "../index-BnQkUs70.mjs";
1
+ import { i as DataTypesObject, r as DataTypes, x as Property } from "../index-CvmUSReI.mjs";
2
2
 
3
3
  //#region src/constants/index.d.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/constants/index.ts"],"mappings":";;;;;;AAA2E;;;;;AAwBlC;;;;;cAAnC,UAAA,EAAY,MAAA,SAAe,QAAA;;;;;;;;;;cA+sC3B,IAAA;;;;;;;;;;;;cAaA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAaA,iBAAA;;;;;;;;cAQA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCA,YAAA,EAAc,SAAA;AAAA,cAEd,UAAA,EAAY,eAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/constants/index.ts"],"mappings":";;;;;;AAA2E;;;;;AAuBlC;;;;;cAAnC,UAAA,EAAY,MAAA,SAAe,QAAA;;;;;;;;;;cA+sC3B,IAAA;;;;;;;;;;;;cAaA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAaA,iBAAA;;;;;;;;cAQA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCA,YAAA,EAAc,SAAA;AAAA,cAEd,UAAA,EAAY,eAAA"}
@@ -1 +1,2 @@
1
- import"../chunk-pm2C21R4.mjs";import"../map-C4ZbQ-N0.mjs";import"../_baseProperty-D8FHbIgx.mjs";import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"../constants-C5KahlYP.mjs";export{o as DATA_TYPES,n as INIT,i as LOOKUP,t as PROPERTIES,e as PROPERTIES_LOOKUP,r as QUERIES,a as getDataTypes};
1
+ import"../chunk-pm2C21R4.mjs";import{filter as e,map as t}from"lodash-es";const n=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),r={addressCity:{init:!0,key:`addressCity`,notion:`Address.City`,type:`rich_text`},addressLatitude:{format:`number`,init:!0,key:`addressLatitude`,notion:`Address.Latitude`,type:`number`},addressLongitude:{format:`number`,init:!0,key:`addressLongitude`,notion:`Address.Longitude`,type:`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:{format:`number`,init:!0,key:`addressZipCode`,notion:`Address.ZipCode`,type:`number`},author:{init:!0,key:`author`,notion:`Author`,type:`rich_text`},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:{format:`number`,init:!0,key:`episode`,notion:`Episode`,type:`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__People_Guest:{init:!0,key:`relationEpisodes__People_Guest`,notion:`Guest`,relation:{database_id:`People`,synced_property_name:`Episodes.Guest`},type:`relation`},relationEpisodes__People_Sound_Engineer:{init:!0,key:`relationEpisodes__People_Sound_Engineer`,notion:`Sound.Engineer`,relation:{database_id:`People`,synced_property_name:`Episodes.Sound.Engineer`},type:`relation`},relationEpisodes__People_Thanks:{init:!0,key:`relationEpisodes__People_Thanks`,notion:`Thanks`,relation:{database_id:`People`,synced_property_name:`Episodes.Thanks`},type:`relation`},relationEpisodes__Podcasts:{init:!0,key:`relationEpisodes__Podcasts`,notion:`Podcasts`,relation:{database_id:`Podcasts`,synced_property_name:`Episodes`},type:`relation`},relationEpisodes__Venues:{init:!0,key:`relationEpisodes__Venues`,notion:`Venues`,relation:{database_id:`Venues`,synced_property_name:`Episodes`},type:`relation`},relationEvents__People_Guest:{init:!0,key:`relationEvents__People_Guest`,notion:`Guest`,relation:{database_id:`People`,synced_property_name:`Events.Guest`},type:`relation`},relationEvents__People_Guest_Music:{init:!0,key:`relationEvents__People_Guest_Music`,notion:`Guest.Music`,relation:{database_id:`People`,synced_property_name:`Events.Guest.Music`},type:`relation`},relationEvents__People_Host:{init:!0,key:`relationEvents__People_Host`,notion:`Host`,relation:{database_id:`People`,synced_property_name:`Events.Host`},type:`relation`},relationEvents__Shows:{init:!0,key:`relationEvents__Shows`,notion:`Shows`,relation:{database_id:`Shows`,synced_property_name:`Events`},type:`relation`},relationEvents__Shows_Lineup:{init:!0,key:`relationEvents__Shows_Lineup`,notion:`Shows.Lineup`,relation:{database_id:`Shows`,synced_property_name:`Events.Lineup`},type:`relation`},relationEvents__Venues:{init:!0,key:`relationEvents__Venues`,notion:`Venues`,relation:{database_id:`Venues`,synced_property_name:`Events`},type:`relation`},relationPeople__Episodes_Guest:{init:!1,key:`relationPeople__Episodes_Guest`,notion:`Episodes.Guest`,relation:{database_id:`Episodes`,synced_property_name:`Guest`},type:`relation`},relationPeople__Episodes_Sound_Engineer:{init:!1,key:`relationPeople__Episodes_Sound_Engineer`,notion:`Episodes.Sound.Engineer`,relation:{database_id:`Episodes`,synced_property_name:`Sound.Engineer`},type:`relation`},relationPeople__Episodes_Thanks:{init:!1,key:`relationPeople__Episodes_Thanks`,notion:`Episodes.Thanks`,relation:{database_id:`Episodes`,synced_property_name:`Thanks`},type:`relation`},relationPeople__Events_Guest:{init:!1,key:`relationEvents__People_Guest`,notion:`Events.Guest`,relation:{database_id:`Events`,synced_property_name:`Guest`},type:`relation`},relationPeople__Events_Guest_Music:{init:!1,key:`relationPeople__Events_Guest_Music`,notion:`Events.Guest.Music`,relation:{database_id:`Events`,synced_property_name:`Guest.Music`},type:`relation`},relationPeople__Events_Host:{init:!1,key:`relationPeople__Events_Host`,notion:`Events.Host`,relation:{database_id:`Events`,synced_property_name:`Host`},type:`relation`},relationPeople__Podcasts_Host:{init:!1,key:`relationPeople__Podcasts_Host`,notion:`Podcasts.Host`,relation:{database_id:`Podcasts`,synced_property_name:`Host`},type:`relation`},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:`relationPeople__Podcasts_Sound_Engineer`,notion:`Podcasts.Sound.Engineer`,relation:{database_id:`Podcasts`,synced_property_name:`Sound.Engineer`},type:`relation`},relationPeople__Shows_Cast:{init:!1,key:`relationPeople__Shows_Cast`,notion:`Shows.Cast`,relation:{database_id:`Shows`,synced_property_name:`Cast`},type:`relation`},relationPeople__Shows_Cast_Past:{init:!1,key:`relationPeople__Shows_Cast_Past`,notion:`Shows.Cast.Past`,relation:{database_id:`Shows`,synced_property_name:`Cast.Past`},type:`relation`},relationPeople__Shows_Crew:{init:!0,key:`relationPeople__Shows_Crew`,notion:`Shows.Crew`,relation:{database_id:`Shows`,synced_property_name:`Crew`},type:`relation`},relationPeople__Shows_Director:{init:!1,key:`relationPeople__Shows_Director`,notion:`Shows.Director`,relation:{database_id:`Shows`,synced_property_name:`Director`},type:`relation`},relationPeople__Shows_Director_Musical:{init:!1,key:`relationPeople__Shows_Director_Musical`,notion:`Shows.Director.Musical`,relation:{database_id:`Shows`,synced_property_name:`Director.Musical`},type:`relation`},relationPeople__Shows_Director_Technical:{init:!1,key:`relationPeople__Shows_Director_Technical`,notion:`Shows.Director.Technical`,relation:{database_id:`Shows`,synced_property_name:`Director.Technical`},type:`relation`},relationPeople__Shows_Producer:{init:!1,key:`relationPeople__Shows_Producer`,notion:`Shows.Producer`,relation:{database_id:`Shows`,synced_property_name:`Producer`},type:`relation`},relationPeople__Shows_Thanks:{init:!1,key:`relationPeople__Shows_Thanks`,notion:`Shows.Thanks`,relation:{database_id:`Shows`,synced_property_name:`Thanks`},type:`relation`},relationPeople__Shows_Writer:{init:!1,key:`relationPeople__Shows_Writer`,notion:`Shows.Writer`,relation:{database_id:`Shows`,synced_property_name:`Writer`},type:`relation`},relationPodcasts__Episodes:{init:!1,key:`relationPodcasts__Episodes`,notion:`Episodes`,relation:{database_id:`Episodes`,synced_property_name:`Podcasts`},type:`relation`},relationPodcasts__People_Host:{init:!0,key:`relationPodcasts__People_Host`,notion:`Host`,relation:{database_id:`People`,synced_property_name:`Podcasts.Host`},type:`relation`},relationPodcasts__People_Sound_Engineer:{init:!0,key:`relationPodcasts__People_Sound_Engineer`,notion:`Sound.Engineer`,relation:{database_id:`Podcasts`,synced_property_name:`Podcasts.Sound.Engineer`},type:`relation`},relationShows__Events:{init:!1,key:`relationShows__Events`,notion:`Events`,relation:{database_id:`Events`,synced_property_name:`Shows`},type:`relation`},relationShows__Events_Lineup:{init:!1,key:`relationShows__Events_Lineup`,notion:`Events.Lineup`,relation:{database_id:`Events`,synced_property_name:`Shows.Lineup`},type:`relation`},relationShows__People_Cast:{init:!0,key:`relationShows__People_Cast`,notion:`Cast`,relation:{database_id:`People`,synced_property_name:`Shows.Cast`},type:`relation`},relationShows__People_Cast_Past:{init:!0,key:`relationShows__People_Cast_Past`,notion:`Cast.Past`,relation:{database_id:`People`,synced_property_name:`Shows.Cast.Past`},type:`relation`},relationShows__People_Director:{init:!0,key:`relationShows__People_Director`,notion:`Director`,relation:{database_id:`People`,synced_property_name:`Shows.Director`},type:`relation`},relationShows__People_Director_Musical:{init:!0,key:`relationShows__People_Director_Musical`,notion:`Director.Musical`,relation:{database_id:`People`,synced_property_name:`Shows.Director.Musical`},type:`relation`},relationShows__People_Director_Technical:{init:!0,key:`relationShows__People_Director_Technical`,notion:`Director.Technical`,relation:{database_id:`People`,synced_property_name:`Shows.Director.Technical`},type:`relation`},relationShows__People_Producer:{init:!0,key:`relationShows__People_Producer`,notion:`Producer`,relation:{database_id:`People`,synced_property_name:`Shows.Producer`},type:`relation`},relationShows__People_Thanks:{init:!0,key:`relationShows__People_Thanks`,notion:`Thanks`,relation:{database_id:`People`,synced_property_name:`Shows.Thanks`},type:`relation`},relationShows__People_Writer:{init:!0,key:`relationShows__People_Writer`,notion:`Writer`,relation:{database_id:`People`,synced_property_name:`Shows.Writer`},type:`relation`},relationShows__Tags:{init:!0,key:`relationShows__Tags`,notion:`Tags`,relation:{database_id:`Tags`,synced_property_name:`Shows`},type:`relation`},relationShows_People_Crew:{init:!0,key:`relationShows_People_Crew`,notion:`Crew`,relation:{database_id:`People`,synced_property_name:`Shows.Crew`},type:`relation`},relationTags__Shows:{init:!1,key:`relationTags__Shows`,notion:`Shows`,relation:{database_id:`Shows`,synced_property_name:`Tags`},type:`relation`},relationVenues__Episodes:{init:!1,key:`relationVenues__Episodes`,notion:`Episodes`,relation:{database_id:`Episodes`,synced_property_name:`Venues`},type:`relation`},relationVenues__Events:{init:!1,key:`relationVenues__Events`,notion:`Events`,relation:{database_id:`Events`,synced_property_name:`Venues`},type:`relation`},rollupEpisodes__Podcasts:{init:!1,key:`rollupEpisodes__Podcasts`,notion:`Podcasts.Rollup`,rollup:{function:`show_original`,relation_property_name:`Podcasts`,rollup_property_id:`Title`},type:`rollup`},rollupEpisodes__PodcastsSlugs:{init:!1,key:`rollupEpisodes__PodcastsSlugs`,notion:`Podcasts.Slug.Rollup`,rollup:{function:`show_original`,relation_property_name:`Podcasts`,rollup_property_id:`Slug`},type:`rollup`},rollupEvents__People_Cast:{init:!1,key:`rollupEvents__People_Cast`,notion:`Cast.Rollup`,rollup:{function:`show_original`,relation_property_name:`Shows`,rollup_property_id:`Cast`},type:`rollup`},rollupEvents__People_Guest:{init:!1,key:`rollupEvents__People_Guest`,notion:`Guest.Rollup`,rollup:{function:`show_original`,relation_property_name:`Guest`,rollup_property_id:`Title`},type:`rollup`},rollupEvents__People_Guest_Music:{init:!1,key:`rollupEvents__People_Guest_Music`,notion:`Guest.Music.Rollup`,rollup:{function:`show_original`,relation_property_name:`Guest.Music`,rollup_property_id:`Title`},type:`rollup`},rollupEvents__People_Host:{init:!1,key:`rollupEvents__People_Host`,notion:`Host.Rollup`,rollup:{function:`show_original`,relation_property_name:`Host`,rollup_property_id:`Title`},type:`rollup`},rollupEvents__Shows:{init:!1,key:`rollupEvents__Shows`,notion:`Shows.Rollup`,rollup:{function:`show_original`,relation_property_name:`Shows`,rollup_property_id:`Title`},type:`rollup`},rollupEvents__Shows_Lineup:{init:!1,key:`rollupEvents__Shows_Lineup`,notion:`Shows.Lineup.Rollup`,rollup:{function:`show_original`,relation_property_name:`Shows.Lineup`,rollup_property_id:`Title`},type:`rollup`},rollupEvents__Venues:{init:!1,key:`rollupEvents__Venues`,notion:`Venues.Rollup`,rollup:{function:`show_original`,relation_property_name:`Venues`,rollup_property_id:`Title`},type:`rollup`},rollupPodcasts__Episodes:{init:!1,key:`rollupPodcasts__Episodes`,notion:`Episodes.Rollup`,rollup:{function:`show_original`,relation_property_name:`Episodes`,rollup_property_id:`Title`},type:`rollup`},rollupPodcasts__EpisodesSlugs:{init:!1,key:`rollupPodcasts__EpisodesSlugs`,notion:`Episodes.Slug.Rollup`,rollup:{function:`show_original`,relation_property_name:`Episodes`,rollup_property_id:`Slug`},type:`rollup`},rollupShows__People_Cast:{init:!1,key:`rollupShows__People_Cast`,notion:`Cast.Rollup`,rollup:{function:`show_original`,relation_property_name:`Cast`,rollup_property_id:`Title`},type:`rollup`},rollupShows__People_Cast_Past:{init:!1,key:`rollupShows__People_Cast_Past`,notion:`Cast.Past.Rollup`,rollup:{function:`show_original`,relation_property_name:`Cast.Past`,rollup_property_id:`Title`},type:`rollup`},rollupShows__People_Cast_Slug:{init:!1,key:`rollupShows__People_Cast_Slug`,notion:`Cast.Rollup.Slug`,rollup:{function:`show_original`,relation_property_name:`Cast`,rollup_property_name:`Slug`},type:`rollup`},rollupShows__People_Crew:{init:!1,key:`rollupShows__People_Crew`,notion:`Crew.Rollup`,rollup:{function:`show_original`,relation_property_name:`Crew`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Director:{init:!1,key:`rollupShows__People_Director`,notion:`Director.Rollup`,rollup:{function:`show_original`,relation_property_name:`Director`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Director_Musical:{init:!1,key:`rollupShows__People_Director_Musical`,notion:`Director.Musical.Rollup`,rollup:{function:`show_original`,relation_property_name:`Director.Musical`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Director_Technical:{init:!1,key:`rollupShows__People_Director_Technical`,notion:`Director.Technical.Rollup`,rollup:{function:`show_original`,relation_property_name:`Director.Technical`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Music:{init:!1,key:`rollupShows__People_Music`,notion:`Music.Rollup`,rollup:{function:`show_original`,relation_property_name:`Music`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Producer:{init:!1,key:`rollupShows__People_Producer`,notion:`Producer.Rollup`,rollup:{function:`show_original`,relation_property_name:`Producer`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Thanks:{init:!1,key:`rollupShows__People_Thanks`,notion:`Thanks.Rollup`,rollup:{function:`show_original`,relation_property_name:`Thanks`,rollup_property_name:`Title`},type:`rollup`},rollupShows__People_Writer:{init:!1,key:`rollupShows__People_Writer`,notion:`Writer.Rollup`,rollup:{function:`show_original`,relation_property_name:`Writer`,rollup_property_name:`Title`},type:`rollup`},rollupShows__Tags:{init:!1,key:`rollupShows__Tags`,notion:`Tags.Rollup`,rollup:{function:`show_original`,relation_property_name:`Tags`,rollup_property_id:`Title`},type:`rollup`},season:{format:`number`,init:!0,key:`season`,notion:`Season`,type:`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`},seoKeywords:{init:!0,key:`seoKeywords`,notion:`SEO.Keywords`,type:`rich_text`},slug:{init:!0,key:`slug`,notion:`Slug`,type:`rich_text`},socialApple:{init:!0,key:`socialApple`,notion:`Social.Apple`,type:`url`},socialFacebook:{init:!0,key:`socialFacebook`,notion:`Social.Facebook`,type:`url`},socialInstagram:{init:!0,key:`socialInstagram`,notion:`Social.Instagram`,type:`url`},socialSpotify:{init:!0,key:`socialSpotify`,notion:`Social.Spotify`,type:`url`},socialTwitter:{init:!0,key:`socialTwitter`,notion:`Social.Twitter`,type:`url`},socialWebsite:{init:!0,key:`socialWebsite`,notion:`Social.Website`,type:`url`},status:{init:!0,key:`status`,notion:`Status`,type:`select`},subtitle:{init:!0,key:`subtitle`,notion:`Subtitle`,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`}},i=[r.authors,r.datePublished,r.isIndexed,r.isPublished,r.slug,r.seoDescription,r.seoImage,r.seoImageDescription,r.seoKeywords,r.title],a=[...i],o=[...i,r.author,r.status,r.subtitle],s=[...i,r.dateRecorded,r.duration,r.episode,r.mp3,r.season,r.relationEpisodes__People_Guest,r.relationEpisodes__People_Sound_Engineer,r.relationEpisodes__People_Thanks,r.relationEpisodes__Podcasts,r.relationEpisodes__Venues,r.socialApple,r.socialSpotify,r.type,r.rollupEpisodes__Podcasts,r.rollupEpisodes__PodcastsSlugs],c=[...i,r.dateEvent,r.relationEvents__People_Guest_Music,r.relationEvents__People_Guest,r.relationEvents__People_Host,r.relationEvents__Shows_Lineup,r.relationEvents__Shows,r.relationEvents__Venues,r.socialFacebook,r.socialWebsite,r.ticketUrl,r.rollupEvents__People_Cast,r.rollupEvents__People_Guest_Music,r.rollupEvents__People_Guest,r.rollupEvents__People_Host,r.rollupEvents__Shows_Lineup,r.rollupEvents__Shows,r.rollupEvents__Venues],l=[...i],u=[...i,r.email,r.nameFirst,r.nameLast,r.namePreferred,r.relationPeople__Episodes_Guest,r.relationPeople__Episodes_Sound_Engineer,r.relationPeople__Episodes_Thanks,r.relationPeople__Events_Guest,r.relationPeople__Events_Guest_Music,r.relationPeople__Events_Host,r.relationPeople__Podcasts_Host,r.relationPeople__Podcasts_Sound_Engineer,r.relationPeople__Shows_Cast,r.relationPeople__Shows_Cast_Past,r.relationPeople__Shows_Director,r.relationPeople__Shows_Director_Musical,r.relationPeople__Shows_Director_Technical,r.relationPeople__Shows_Producer,r.relationPeople__Shows_Thanks,r.relationPeople__Shows_Writer],d=[...i,r.categories,r.explicit,r.podcastAuthor,r.podcastAuthorEmail,r.relationPodcasts__People_Host,r.relationPodcasts__People_Sound_Engineer,r.socialApple,r.socialSpotify,r.type,r.relationPodcasts__Episodes,r.rollupPodcasts__Episodes,r.rollupPodcasts__EpisodesSlugs],f=[...i],p=[...i,r.relationShows__People_Cast,r.relationShows__People_Cast_Past,r.relationShows__People_Director,r.relationShows__People_Director_Musical,r.relationShows__People_Director_Technical,r.relationShows__People_Producer,r.relationShows__People_Thanks,r.relationShows__People_Writer,r.relationShows__Tags,r.socialFacebook,r.socialInstagram,r.socialTwitter,r.socialWebsite,r.relationShows__Events,r.relationShows__Events_Lineup,r.rollupShows__People_Cast,r.rollupShows__People_Cast_Slug,r.rollupShows__People_Cast_Past,r.rollupShows__People_Crew,r.rollupShows__People_Director,r.rollupShows__People_Director_Musical,r.rollupShows__People_Director_Technical,r.rollupShows__People_Music,r.rollupShows__People_Producer,r.rollupShows__People_Thanks,r.rollupShows__People_Writer,r.rollupShows__Tags],m=[...i,r.addressCity,r.addressLatitude,r.addressLongitude,r.addressNeighborhood,r.addressState,r.addressStreet,r.addressZipCode,r.phoneNumber,r.socialFacebook,r.socialInstagram,r.socialTwitter,r.socialWebsite,r.relationVenues__Episodes,r.relationVenues__Events],h={BLOG:e(a,{init:!0}),BOOKS:e(o,{init:!0}),EPISODES:e(s,{init:!0}),EVENTS:e(c,{init:!0}),PAGES:e(l,{init:!0}),PEOPLE:e(u,{init:!0}),PODCASTS:e(d,{init:!0}),SEO:e(f,{init:!0}),SHOWS:e(p,{init:!0}),VENUES:e(m,{init:!0})},g={BLOG:a.map(e=>n(e)),BOOKS:o.map(e=>n(e)),EPISODES:s.map(e=>n(e)),EVENTS:c.map(e=>n(e)),PAGES:l.map(e=>n(e)),PEOPLE:u.map(e=>n(e)),PODCASTS:d.map(e=>n(e)),SEO:f.map(e=>n(e)),SHOWS:p.map(e=>n(e)),VENUES:m.map(e=>n(e))},_=t(r,e=>n(e)),v=new Date().toISOString(),y={dateBefore:{date:{before:v},property:r.datePublished.notion},dateOnOrAfter:{date:{on_or_after:v},property:r.datePublished.notion},published:{checkbox:{equals:!1},property:r.isPublished.notion},slug:{property:r.slug.notion,rich_text:{equals:``}}},b=[`LISTING`,`LISTING_BY_DATE`,`SLUG`,`SLUG_BY_ROUTE`],x=Object.assign({},...b.flatMap(e=>({[e]:e})));export{x as DATA_TYPES,h as INIT,g as LOOKUP,r as PROPERTIES,_ as PROPERTIES_LOOKUP,y as QUERIES,b as getDataTypes};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["_filter","_map"],"sources":["../../src/constants/index.ts"],"sourcesContent":["import type { DataTypes, DataTypesObject, Property } from '../schema/index'\n\nimport { filter as _filter, map as _map } from 'lodash-es'\n\nconst getLookup = ({ key, notion, type }) => ({\n key,\n notion,\n type,\n})\n\n/**\n * @note\n * Valid Notion Property Types mapped to Normalizer w/ init info\n *\n * *********************\n * RELATIONS and ROLLUPS\n * *********************\n *\n * For each RELATION or ROLLUP there can be only one init\n * During the build process this happens in waves\n *\n *\n */\nconst PROPERTIES: Record<string, Property> = {\n addressCity: {\n init: true,\n key: 'addressCity',\n notion: 'Address.City',\n type: 'rich_text',\n },\n addressLatitude: {\n format: 'number',\n init: true,\n key: 'addressLatitude',\n notion: 'Address.Latitude',\n type: 'number',\n },\n addressLongitude: {\n format: 'number',\n init: true,\n key: 'addressLongitude',\n notion: 'Address.Longitude',\n type: 'number',\n },\n addressNeighborhood: {\n init: true,\n key: 'addressNeighborhood',\n notion: 'Address.Neighborhood',\n type: 'rich_text',\n },\n addressState: {\n init: true,\n key: 'addressState',\n notion: 'Address.State',\n type: 'select',\n },\n addressStreet: {\n init: true,\n key: 'addressStreet',\n notion: 'Address.Street',\n type: 'rich_text',\n },\n addressZipCode: {\n format: 'number',\n init: true,\n key: 'addressZipCode',\n notion: 'Address.ZipCode',\n type: 'number',\n },\n author: {\n init: true,\n key: 'author',\n notion: 'Author',\n type: 'rich_text',\n },\n authors: {\n init: true,\n key: 'authors',\n notion: 'Authors',\n type: 'people',\n },\n categories: {\n init: true,\n key: 'categories',\n notion: 'Categories',\n type: 'multi_select',\n },\n dateCreated: {\n init: false,\n key: 'dateCreated',\n notion: 'Date.Created',\n type: 'created_time',\n },\n dateEdited: {\n init: false,\n key: 'dateEdited',\n notion: 'Date.Edited',\n type: 'last_edited_time',\n },\n dateEvent: {\n init: true,\n key: 'dateEvent',\n notion: 'Date.Event',\n type: 'date',\n },\n datePublished: {\n init: true,\n key: 'datePublished',\n notion: 'Date.Published',\n type: 'date',\n },\n dateRecorded: {\n init: true,\n key: 'dateRecorded',\n notion: 'Date.Recorded',\n type: 'date',\n },\n duration: {\n init: true,\n key: 'duration',\n notion: 'Duration',\n type: 'rich_text',\n },\n email: {\n init: true,\n key: 'email',\n notion: 'Email',\n type: 'rich_text',\n },\n episode: {\n format: 'number',\n init: true,\n key: 'episode',\n notion: 'Episode',\n type: 'number',\n },\n explicit: {\n init: true,\n key: 'explicit',\n notion: 'Explicit',\n type: 'checkbox',\n },\n festivals: {\n init: true,\n key: 'festivals',\n notion: 'Festival',\n type: 'multi_select',\n },\n food: {\n init: true,\n key: 'food',\n notion: 'Food',\n type: 'rich_text',\n },\n isIndexed: {\n init: true,\n key: 'isIndexed',\n notion: 'Is.Indexed',\n type: 'checkbox',\n },\n isPublished: {\n init: true,\n key: 'isPublished',\n notion: 'Is.Published',\n type: 'checkbox',\n },\n mp3: {\n init: true,\n key: 'mp3',\n notion: 'MP3',\n type: 'files',\n },\n name: {\n init: true,\n key: 'name',\n notion: 'Name',\n type: 'rich_text',\n },\n nameFirst: {\n init: true,\n key: 'nameFirst',\n notion: 'Name.First',\n type: 'rich_text',\n },\n nameLast: {\n init: true,\n key: 'nameLast',\n notion: 'Name.Last',\n type: 'rich_text',\n },\n namePreferred: {\n init: true,\n key: 'namePreferred',\n notion: 'Name.Preferred',\n type: 'rich_text',\n },\n phoneNumber: {\n init: true,\n key: 'phoneNumber',\n notion: 'Phone',\n type: 'rich_text',\n },\n podcastAuthor: {\n init: true,\n key: 'podcastAuthor',\n notion: 'Author',\n type: 'rich_text',\n },\n podcastAuthorEmail: {\n init: true,\n key: 'podcastAuthorEmail',\n notion: 'Author.Email',\n type: 'rich_text',\n },\n relationEpisodes__People_Guest: {\n init: true,\n key: 'relationEpisodes__People_Guest',\n notion: 'Guest',\n relation: {\n database_id: 'People',\n synced_property_name: 'Episodes.Guest',\n },\n type: 'relation',\n },\n relationEpisodes__People_Sound_Engineer: {\n init: true,\n key: 'relationEpisodes__People_Sound_Engineer',\n notion: 'Sound.Engineer',\n relation: {\n database_id: 'People',\n synced_property_name: 'Episodes.Sound.Engineer',\n },\n type: 'relation',\n },\n relationEpisodes__People_Thanks: {\n init: true,\n key: 'relationEpisodes__People_Thanks',\n notion: 'Thanks',\n relation: {\n database_id: 'People',\n synced_property_name: 'Episodes.Thanks',\n },\n type: 'relation',\n },\n /**\n * @relation\n */\n relationEpisodes__Podcasts: {\n init: true,\n key: 'relationEpisodes__Podcasts',\n notion: 'Podcasts',\n relation: {\n database_id: 'Podcasts',\n synced_property_name: 'Episodes',\n },\n type: 'relation',\n },\n relationEpisodes__Venues: {\n init: true,\n key: 'relationEpisodes__Venues',\n notion: 'Venues',\n relation: {\n database_id: 'Venues',\n synced_property_name: 'Episodes',\n },\n type: 'relation',\n },\n relationEvents__People_Guest: {\n init: true,\n key: 'relationEvents__People_Guest',\n notion: 'Guest',\n relation: {\n database_id: 'People',\n synced_property_name: 'Events.Guest',\n },\n type: 'relation',\n },\n\n relationEvents__People_Guest_Music: {\n init: true,\n key: 'relationEvents__People_Guest_Music',\n notion: 'Guest.Music',\n relation: {\n database_id: 'People',\n synced_property_name: 'Events.Guest.Music',\n },\n type: 'relation',\n },\n relationEvents__People_Host: {\n init: true,\n key: 'relationEvents__People_Host',\n notion: 'Host',\n relation: {\n database_id: 'People',\n synced_property_name: 'Events.Host',\n },\n type: 'relation',\n },\n relationEvents__Shows: {\n init: true,\n key: 'relationEvents__Shows',\n notion: 'Shows',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Events',\n },\n type: 'relation',\n },\n relationEvents__Shows_Lineup: {\n init: true,\n key: 'relationEvents__Shows_Lineup',\n notion: 'Shows.Lineup',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Events.Lineup',\n },\n type: 'relation',\n },\n relationEvents__Venues: {\n init: true,\n key: 'relationEvents__Venues',\n notion: 'Venues',\n relation: {\n database_id: 'Venues',\n synced_property_name: 'Events',\n },\n type: 'relation',\n },\n relationPeople__Episodes_Guest: {\n init: false,\n key: 'relationPeople__Episodes_Guest',\n notion: 'Episodes.Guest',\n relation: {\n database_id: 'Episodes',\n synced_property_name: 'Guest',\n },\n type: 'relation',\n },\n relationPeople__Episodes_Sound_Engineer: {\n init: false,\n key: 'relationPeople__Episodes_Sound_Engineer',\n notion: 'Episodes.Sound.Engineer',\n relation: {\n database_id: 'Episodes',\n synced_property_name: 'Sound.Engineer',\n },\n type: 'relation',\n },\n relationPeople__Episodes_Thanks: {\n init: false,\n key: 'relationPeople__Episodes_Thanks',\n notion: 'Episodes.Thanks',\n relation: {\n database_id: 'Episodes',\n synced_property_name: 'Thanks',\n },\n type: 'relation',\n },\n relationPeople__Events_Guest: {\n init: false,\n key: 'relationEvents__People_Guest',\n notion: 'Events.Guest',\n relation: {\n database_id: 'Events',\n synced_property_name: 'Guest',\n },\n type: 'relation',\n },\n relationPeople__Events_Guest_Music: {\n init: false,\n key: 'relationPeople__Events_Guest_Music',\n notion: 'Events.Guest.Music',\n relation: {\n database_id: 'Events',\n synced_property_name: 'Guest.Music',\n },\n type: 'relation',\n },\n relationPeople__Events_Host: {\n init: false,\n key: 'relationPeople__Events_Host',\n notion: 'Events.Host',\n relation: {\n database_id: 'Events',\n synced_property_name: 'Host',\n },\n type: 'relation',\n },\n relationPeople__Podcasts_Host: {\n init: false,\n key: 'relationPeople__Podcasts_Host',\n notion: 'Podcasts.Host',\n relation: {\n database_id: 'Podcasts',\n synced_property_name: 'Host',\n },\n type: 'relation',\n },\n relationPeople__Podcasts_Sound_Engineer: {\n init: false,\n key: 'relationPeople__Podcasts_Sound_Engineer',\n notion: 'Podcasts.Sound.Engineer',\n relation: {\n database_id: 'Podcasts',\n synced_property_name: 'Sound.Engineer',\n },\n type: 'relation',\n },\n relationPeople__Shows_Cast: {\n init: false,\n key: 'relationPeople__Shows_Cast',\n notion: 'Shows.Cast',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Cast',\n },\n type: 'relation',\n },\n relationPeople__Shows_Cast_Past: {\n init: false,\n key: 'relationPeople__Shows_Cast_Past',\n notion: 'Shows.Cast.Past',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Cast.Past',\n },\n type: 'relation',\n },\n relationPeople__Shows_Crew: {\n init: true,\n key: 'relationPeople__Shows_Crew',\n notion: 'Shows.Crew',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Crew',\n },\n type: 'relation',\n },\n relationPeople__Shows_Director: {\n init: false,\n key: 'relationPeople__Shows_Director',\n notion: 'Shows.Director',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Director',\n },\n type: 'relation',\n },\n relationPeople__Shows_Director_Musical: {\n init: false,\n key: 'relationPeople__Shows_Director_Musical',\n notion: 'Shows.Director.Musical',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Director.Musical',\n },\n type: 'relation',\n },\n relationPeople__Shows_Director_Technical: {\n init: false,\n key: 'relationPeople__Shows_Director_Technical',\n notion: 'Shows.Director.Technical',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Director.Technical',\n },\n type: 'relation',\n },\n relationPeople__Shows_Producer: {\n init: false,\n key: 'relationPeople__Shows_Producer',\n notion: 'Shows.Producer',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Producer',\n },\n type: 'relation',\n },\n relationPeople__Shows_Thanks: {\n init: false,\n key: 'relationPeople__Shows_Thanks',\n notion: 'Shows.Thanks',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Thanks',\n },\n type: 'relation',\n },\n relationPeople__Shows_Writer: {\n init: false,\n key: 'relationPeople__Shows_Writer',\n notion: 'Shows.Writer',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Writer',\n },\n type: 'relation',\n },\n relationPodcasts__Episodes: {\n init: false,\n key: 'relationPodcasts__Episodes',\n notion: 'Episodes',\n relation: {\n database_id: 'Episodes',\n synced_property_name: 'Podcasts',\n },\n type: 'relation',\n },\n relationPodcasts__People_Host: {\n init: true,\n key: 'relationPodcasts__People_Host',\n notion: 'Host',\n relation: {\n database_id: 'People',\n synced_property_name: 'Podcasts.Host',\n },\n type: 'relation',\n },\n relationPodcasts__People_Sound_Engineer: {\n init: true,\n key: 'relationPodcasts__People_Sound_Engineer',\n notion: 'Sound.Engineer',\n relation: {\n database_id: 'Podcasts',\n synced_property_name: 'Podcasts.Sound.Engineer',\n },\n type: 'relation',\n },\n relationShows__Events: {\n init: false,\n key: 'relationShows__Events',\n notion: 'Events',\n relation: {\n database_id: 'Events',\n synced_property_name: 'Shows',\n },\n type: 'relation',\n },\n relationShows__Events_Lineup: {\n init: false,\n key: 'relationShows__Events_Lineup',\n notion: 'Events.Lineup',\n relation: {\n database_id: 'Events',\n synced_property_name: 'Shows.Lineup',\n },\n type: 'relation',\n },\n relationShows__People_Cast: {\n init: true,\n key: 'relationShows__People_Cast',\n notion: 'Cast',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Cast',\n },\n type: 'relation',\n },\n relationShows__People_Cast_Past: {\n init: true,\n key: 'relationShows__People_Cast_Past',\n notion: 'Cast.Past',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Cast.Past',\n },\n type: 'relation',\n },\n relationShows__People_Director: {\n init: true,\n key: 'relationShows__People_Director',\n notion: 'Director',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Director',\n },\n type: 'relation',\n },\n relationShows__People_Director_Musical: {\n init: true,\n key: 'relationShows__People_Director_Musical',\n notion: 'Director.Musical',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Director.Musical',\n },\n type: 'relation',\n },\n relationShows__People_Director_Technical: {\n init: true,\n key: 'relationShows__People_Director_Technical',\n notion: 'Director.Technical',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Director.Technical',\n },\n type: 'relation',\n },\n relationShows__People_Producer: {\n init: true,\n key: 'relationShows__People_Producer',\n notion: 'Producer',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Producer',\n },\n type: 'relation',\n },\n relationShows__People_Thanks: {\n init: true,\n key: 'relationShows__People_Thanks',\n notion: 'Thanks',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Thanks',\n },\n type: 'relation',\n },\n relationShows__People_Writer: {\n init: true,\n key: 'relationShows__People_Writer',\n notion: 'Writer',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Writer',\n },\n type: 'relation',\n },\n relationShows__Tags: {\n init: true,\n key: 'relationShows__Tags',\n notion: 'Tags',\n relation: {\n database_id: 'Tags',\n synced_property_name: 'Shows',\n },\n type: 'relation',\n },\n relationShows_People_Crew: {\n init: true,\n key: 'relationShows_People_Crew',\n notion: 'Crew',\n relation: {\n database_id: 'People',\n synced_property_name: 'Shows.Crew',\n },\n type: 'relation',\n },\n relationTags__Shows: {\n init: false,\n key: 'relationTags__Shows',\n notion: 'Shows',\n relation: {\n database_id: 'Shows',\n synced_property_name: 'Tags',\n },\n type: 'relation',\n },\n relationVenues__Episodes: {\n init: false,\n key: 'relationVenues__Episodes',\n notion: 'Episodes',\n relation: {\n database_id: 'Episodes',\n synced_property_name: 'Venues',\n },\n type: 'relation',\n },\n relationVenues__Events: {\n init: false,\n key: 'relationVenues__Events',\n notion: 'Events',\n relation: {\n database_id: 'Events',\n synced_property_name: 'Venues',\n },\n type: 'relation',\n },\n rollupEpisodes__Podcasts: {\n init: false,\n key: 'rollupEpisodes__Podcasts',\n notion: 'Podcasts.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Podcasts',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupEpisodes__PodcastsSlugs: {\n init: false,\n key: 'rollupEpisodes__PodcastsSlugs',\n notion: 'Podcasts.Slug.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Podcasts',\n rollup_property_id: 'Slug',\n },\n type: 'rollup',\n },\n //\n rollupEvents__People_Cast: {\n init: false,\n key: 'rollupEvents__People_Cast',\n notion: 'Cast.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Shows',\n rollup_property_id: 'Cast',\n },\n type: 'rollup',\n },\n rollupEvents__People_Guest: {\n init: false,\n key: 'rollupEvents__People_Guest',\n notion: 'Guest.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Guest',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupEvents__People_Guest_Music: {\n init: false,\n key: 'rollupEvents__People_Guest_Music',\n notion: 'Guest.Music.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Guest.Music',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupEvents__People_Host: {\n init: false,\n key: 'rollupEvents__People_Host',\n notion: 'Host.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Host',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupEvents__Shows: {\n init: false,\n key: 'rollupEvents__Shows',\n notion: 'Shows.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Shows',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupEvents__Shows_Lineup: {\n init: false,\n key: 'rollupEvents__Shows_Lineup',\n notion: 'Shows.Lineup.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Shows.Lineup',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupEvents__Venues: {\n init: false,\n key: 'rollupEvents__Venues',\n notion: 'Venues.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Venues',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupPodcasts__Episodes: {\n init: false,\n key: 'rollupPodcasts__Episodes',\n notion: 'Episodes.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Episodes',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupPodcasts__EpisodesSlugs: {\n init: false,\n key: 'rollupPodcasts__EpisodesSlugs',\n notion: 'Episodes.Slug.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Episodes',\n rollup_property_id: 'Slug',\n },\n type: 'rollup',\n },\n /**\n * @rollup\n */\n rollupShows__People_Cast: {\n init: false,\n key: 'rollupShows__People_Cast',\n notion: 'Cast.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Cast',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Cast_Past: {\n init: false,\n key: 'rollupShows__People_Cast_Past',\n notion: 'Cast.Past.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Cast.Past',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Cast_Slug: {\n init: false,\n key: 'rollupShows__People_Cast_Slug',\n notion: 'Cast.Rollup.Slug',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Cast',\n rollup_property_name: 'Slug',\n },\n type: 'rollup',\n },\n rollupShows__People_Crew: {\n init: false,\n key: 'rollupShows__People_Crew',\n notion: 'Crew.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Crew',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Director: {\n init: false,\n key: 'rollupShows__People_Director',\n notion: 'Director.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Director',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Director_Musical: {\n init: false,\n key: 'rollupShows__People_Director_Musical',\n notion: 'Director.Musical.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Director.Musical',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Director_Technical: {\n init: false,\n key: 'rollupShows__People_Director_Technical',\n notion: 'Director.Technical.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Director.Technical',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Music: {\n init: false,\n key: 'rollupShows__People_Music',\n notion: 'Music.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Music',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Producer: {\n init: false,\n key: 'rollupShows__People_Producer',\n notion: 'Producer.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Producer',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Thanks: {\n init: false,\n key: 'rollupShows__People_Thanks',\n notion: 'Thanks.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Thanks',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__People_Writer: {\n init: false,\n key: 'rollupShows__People_Writer',\n notion: 'Writer.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Writer',\n rollup_property_name: 'Title',\n },\n type: 'rollup',\n },\n rollupShows__Tags: {\n init: false,\n key: 'rollupShows__Tags',\n notion: 'Tags.Rollup',\n rollup: {\n function: 'show_original',\n relation_property_name: 'Tags',\n rollup_property_id: 'Title',\n },\n type: 'rollup',\n },\n season: {\n format: 'number',\n init: true,\n key: 'season',\n notion: 'Season',\n type: 'number',\n },\n seoDescription: {\n init: true,\n key: 'seoDescription',\n notion: 'SEO.Description',\n type: 'rich_text',\n },\n seoImage: {\n init: true,\n key: 'seoImage',\n notion: 'SEO.Image',\n type: 'files',\n },\n seoImageDescription: {\n init: true,\n key: 'seoImageDescription',\n notion: 'SEO.Image.Description',\n type: 'rich_text',\n },\n seoKeywords: {\n init: true,\n key: 'seoKeywords',\n notion: 'SEO.Keywords',\n type: 'rich_text',\n },\n slug: {\n init: true,\n key: 'slug',\n notion: 'Slug',\n type: 'rich_text',\n },\n socialApple: {\n init: true,\n key: 'socialApple',\n notion: 'Social.Apple',\n type: 'url',\n },\n socialFacebook: {\n init: true,\n key: 'socialFacebook',\n notion: 'Social.Facebook',\n type: 'url',\n },\n socialInstagram: {\n init: true,\n key: 'socialInstagram',\n notion: 'Social.Instagram',\n type: 'url',\n },\n socialSpotify: {\n init: true,\n key: 'socialSpotify',\n notion: 'Social.Spotify',\n type: 'url',\n },\n socialTwitter: {\n init: true,\n key: 'socialTwitter',\n notion: 'Social.Twitter',\n type: 'url',\n },\n socialWebsite: {\n init: true,\n key: 'socialWebsite',\n notion: 'Social.Website',\n type: 'url',\n },\n status: {\n init: true,\n key: 'status',\n notion: 'Status',\n type: 'select',\n },\n subtitle: {\n init: true,\n key: 'subtitle',\n notion: 'Subtitle',\n type: 'rich_text',\n },\n ticketUrl: {\n init: true,\n key: 'ticketUrl',\n notion: 'TicketUrl',\n type: 'url',\n },\n title: {\n init: true,\n key: 'title',\n notion: 'Title',\n type: 'title',\n },\n type: {\n init: true,\n key: 'type',\n notion: 'Type',\n type: 'select',\n },\n}\n\n/**\n * @note\n * Limit Each Database (Route Type) to _only_\n * have valid data for its schema\n */\n\nconst PROPERTIES_DEFAULT = [\n PROPERTIES.authors,\n // PROPERTIES.dateCreated,\n PROPERTIES.datePublished,\n PROPERTIES.isIndexed,\n PROPERTIES.isPublished,\n PROPERTIES.slug,\n PROPERTIES.seoDescription,\n PROPERTIES.seoImage,\n PROPERTIES.seoImageDescription,\n PROPERTIES.seoKeywords,\n PROPERTIES.title,\n]\n\nconst BLOG = [...PROPERTIES_DEFAULT]\n\nconst BOOKS = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.author,\n PROPERTIES.status,\n PROPERTIES.subtitle,\n]\n\nconst EPISODES = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.dateRecorded,\n PROPERTIES.duration,\n PROPERTIES.episode,\n PROPERTIES.mp3,\n PROPERTIES.season,\n PROPERTIES.relationEpisodes__People_Guest,\n PROPERTIES.relationEpisodes__People_Sound_Engineer,\n PROPERTIES.relationEpisodes__People_Thanks,\n PROPERTIES.relationEpisodes__Podcasts,\n PROPERTIES.relationEpisodes__Venues,\n PROPERTIES.socialApple,\n PROPERTIES.socialSpotify,\n PROPERTIES.type,\n /**\n * @note(notion)\n * do not init/seed these values, they are updated _after_ init\n */\n // PROPERTIES.rollupEpisodes__People_Guest,\n // PROPERTIES.rollupEpisodes__People_Sound_Engineer,\n // PROPERTIES.rollupEpisodes__People_Thanks,\n PROPERTIES.rollupEpisodes__Podcasts,\n PROPERTIES.rollupEpisodes__PodcastsSlugs,\n // PROPERTIES.rollupEpisodes__Venues,\n]\n\nconst EVENTS = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.dateEvent,\n PROPERTIES.relationEvents__People_Guest_Music,\n PROPERTIES.relationEvents__People_Guest,\n PROPERTIES.relationEvents__People_Host,\n PROPERTIES.relationEvents__Shows_Lineup,\n PROPERTIES.relationEvents__Shows,\n PROPERTIES.relationEvents__Venues,\n PROPERTIES.socialFacebook,\n PROPERTIES.socialWebsite,\n PROPERTIES.ticketUrl,\n /**\n * @note(notion)\n * do not init/seed these values, they are updated _after_ init\n */\n PROPERTIES.rollupEvents__People_Cast,\n PROPERTIES.rollupEvents__People_Guest_Music,\n PROPERTIES.rollupEvents__People_Guest,\n PROPERTIES.rollupEvents__People_Host,\n PROPERTIES.rollupEvents__Shows_Lineup,\n PROPERTIES.rollupEvents__Shows,\n PROPERTIES.rollupEvents__Venues,\n /**\n * -------------------------------------\n */\n]\n\nconst PAGES = [...PROPERTIES_DEFAULT]\n\nconst PEOPLE = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.email,\n PROPERTIES.nameFirst,\n PROPERTIES.nameLast,\n PROPERTIES.namePreferred,\n /**\n * @note(notion)\n * do not init/seed these values, they are updated _after_ init\n */\n PROPERTIES.relationPeople__Episodes_Guest,\n PROPERTIES.relationPeople__Episodes_Sound_Engineer,\n PROPERTIES.relationPeople__Episodes_Thanks,\n PROPERTIES.relationPeople__Events_Guest,\n PROPERTIES.relationPeople__Events_Guest_Music,\n PROPERTIES.relationPeople__Events_Host,\n PROPERTIES.relationPeople__Podcasts_Host,\n PROPERTIES.relationPeople__Podcasts_Sound_Engineer,\n PROPERTIES.relationPeople__Shows_Cast,\n PROPERTIES.relationPeople__Shows_Cast_Past,\n PROPERTIES.relationPeople__Shows_Director,\n PROPERTIES.relationPeople__Shows_Director_Musical,\n PROPERTIES.relationPeople__Shows_Director_Technical,\n PROPERTIES.relationPeople__Shows_Producer,\n PROPERTIES.relationPeople__Shows_Thanks,\n PROPERTIES.relationPeople__Shows_Writer,\n /**\n * -------------------------------------\n */\n]\n\nconst PODCASTS = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.categories,\n PROPERTIES.explicit,\n PROPERTIES.podcastAuthor,\n PROPERTIES.podcastAuthorEmail,\n PROPERTIES.relationPodcasts__People_Host,\n PROPERTIES.relationPodcasts__People_Sound_Engineer,\n PROPERTIES.socialApple,\n PROPERTIES.socialSpotify,\n PROPERTIES.type,\n /**\n * @note(notion)\n * do not init/seed these values, they are updated _after_ init\n */\n PROPERTIES.relationPodcasts__Episodes,\n PROPERTIES.rollupPodcasts__Episodes,\n PROPERTIES.rollupPodcasts__EpisodesSlugs,\n /**\n * -------------------------------------\n */\n]\n\nconst SEO = [...PROPERTIES_DEFAULT]\n\nconst SHOWS = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.relationShows__People_Cast,\n PROPERTIES.relationShows__People_Cast_Past,\n PROPERTIES.relationShows__People_Director,\n PROPERTIES.relationShows__People_Director_Musical,\n PROPERTIES.relationShows__People_Director_Technical,\n PROPERTIES.relationShows__People_Producer,\n PROPERTIES.relationShows__People_Thanks,\n PROPERTIES.relationShows__People_Writer,\n PROPERTIES.relationShows__Tags,\n PROPERTIES.socialFacebook,\n PROPERTIES.socialInstagram,\n PROPERTIES.socialTwitter,\n PROPERTIES.socialWebsite,\n /**\n * @note(notion)\n * do not init/seed these values, they are updated _after_ init\n */\n PROPERTIES.relationShows__Events,\n PROPERTIES.relationShows__Events_Lineup,\n PROPERTIES.rollupShows__People_Cast,\n PROPERTIES.rollupShows__People_Cast_Slug,\n PROPERTIES.rollupShows__People_Cast_Past,\n PROPERTIES.rollupShows__People_Crew,\n PROPERTIES.rollupShows__People_Director,\n PROPERTIES.rollupShows__People_Director_Musical,\n PROPERTIES.rollupShows__People_Director_Technical,\n PROPERTIES.rollupShows__People_Music,\n PROPERTIES.rollupShows__People_Producer,\n PROPERTIES.rollupShows__People_Thanks,\n PROPERTIES.rollupShows__People_Writer,\n PROPERTIES.rollupShows__Tags,\n /**\n * -------------------------------------\n */\n]\n\nconst VENUES = [\n ...PROPERTIES_DEFAULT,\n PROPERTIES.addressCity,\n PROPERTIES.addressLatitude,\n PROPERTIES.addressLongitude,\n PROPERTIES.addressNeighborhood,\n PROPERTIES.addressState,\n PROPERTIES.addressStreet,\n PROPERTIES.addressZipCode,\n PROPERTIES.phoneNumber,\n PROPERTIES.socialFacebook,\n PROPERTIES.socialInstagram,\n PROPERTIES.socialTwitter,\n PROPERTIES.socialWebsite,\n /**\n * @note(notion)\n * do not init/seed these values, they are updated _after_ init\n */\n PROPERTIES.relationVenues__Episodes,\n PROPERTIES.relationVenues__Events,\n /**\n * -------------------------------------\n */\n]\n\n/**\n * @note\n * hyper-specific for the init / see (secret/create/init)\n *\n * 0. Create DB w/o Relations|Rollups\n * 1. Update DB w/ Relations\n * 2. Update DB w/ Relation Naming Preference\n * 3. Update DB w/ Rollups\n */\nconst INIT = {\n BLOG: _filter(BLOG, { init: true }),\n BOOKS: _filter(BOOKS, { init: true }),\n EPISODES: _filter(EPISODES, { init: true }),\n EVENTS: _filter(EVENTS, { init: true }),\n PAGES: _filter(PAGES, { init: true }),\n PEOPLE: _filter(PEOPLE, { init: true }),\n PODCASTS: _filter(PODCASTS, { init: true }),\n SEO: _filter(SEO, { init: true }),\n SHOWS: _filter(SHOWS, { init: true }),\n VENUES: _filter(VENUES, { init: true }),\n}\n\nconst LOOKUP = {\n BLOG: BLOG.map((item) => getLookup(item)),\n BOOKS: BOOKS.map((item) => getLookup(item)),\n EPISODES: EPISODES.map((item) => getLookup(item)),\n EVENTS: EVENTS.map((item) => getLookup(item)),\n PAGES: PAGES.map((item) => getLookup(item)),\n PEOPLE: PEOPLE.map((item) => getLookup(item)),\n PODCASTS: PODCASTS.map((item) => getLookup(item)),\n SEO: SEO.map((item) => getLookup(item)),\n SHOWS: SHOWS.map((item) => getLookup(item)),\n VENUES: VENUES.map((item) => getLookup(item)),\n}\n\nconst PROPERTIES_LOOKUP = _map(PROPERTIES, (item) => getLookup(item))\n\nconst dateTimestamp = new Date().toISOString()\n// const dateTimestampBlog = new Date('2020-01-01').toISOString()\n\n/**\n * @note(notion) right now we are only using `QUERIES.slug`\n */\nconst QUERIES = {\n // @todo(notion) Published or Event?\n dateBefore: {\n date: {\n before: dateTimestamp,\n },\n property: PROPERTIES.datePublished.notion,\n },\n // @todo(notion) Published or Event?\n dateOnOrAfter: {\n date: {\n on_or_after: dateTimestamp,\n },\n property: PROPERTIES.datePublished.notion,\n },\n published: {\n checkbox: {\n equals: false,\n },\n property: PROPERTIES.isPublished.notion,\n },\n slug: {\n property: PROPERTIES.slug.notion,\n rich_text: {\n equals: '',\n },\n },\n}\n\nconst LISTING: DataTypes = 'LISTING'\nconst LISTING_BY_DATE: DataTypes = 'LISTING_BY_DATE'\nconst SLUG: DataTypes = 'SLUG'\nconst SLUG_BY_ROUTE: DataTypes = 'SLUG_BY_ROUTE'\n\nconst getDataTypes: DataTypes[] = [LISTING, LISTING_BY_DATE, SLUG, SLUG_BY_ROUTE]\n\nconst DATA_TYPES: DataTypesObject = Object.assign(\n {},\n // @ts-ignore\n ...getDataTypes.flatMap((d) => ({ [d]: d })),\n)\n\nexport {\n DATA_TYPES,\n getDataTypes,\n INIT,\n LOOKUP,\n PROPERTIES,\n PROPERTIES_LOOKUP,\n QUERIES,\n}\n"],"mappings":"0EAIA,MAAM,GAAa,CAAE,MAAK,SAAQ,WAAY,CAC5C,MACA,SACA,OACD,EAeK,EAAuC,CAC3C,YAAa,CACX,KAAM,GACN,IAAK,cACL,OAAQ,eACR,KAAM,YACP,CACD,gBAAiB,CACf,OAAQ,SACR,KAAM,GACN,IAAK,kBACL,OAAQ,mBACR,KAAM,SACP,CACD,iBAAkB,CAChB,OAAQ,SACR,KAAM,GACN,IAAK,mBACL,OAAQ,oB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,KAAM,CACJ,YAAa,EACd,CACD,SAAU,EAAW,cAAc,OACpC,CACD,UAAW,CACT,SAAU,CACR,OAAQ,GACT,CACD,SAAU,EAAW,YAAY,OAClC,CACD,KAAM,CACJ,SAAU,EAAW,KAAK,OAC1B,UAAW,CACT,OAAQ,GACT,CACF,CACF,CAOK,EAA4B,CAAC,UAAS,kBAAiB,OAAM,gBAAc,CAE3E,EAA8B,OAAO,OACzC,EAAE,CAEF,GAAG,EAAa,QAAS,IAAO,EAAG,GAAI,EAAG,EAAE,CAC7C"}
@@ -0,0 +1,2 @@
1
+ import e from"./utils/getTypes/_unsupported.mjs";import t from"./utils/getTypes/checkbox.mjs";import n from"./utils/getTypes/date.mjs";import r from"./utils/getTypes/email.mjs";import i from"./utils/getTypes/files.mjs";import a from"./utils/getTypes/multi_select.mjs";import o from"./utils/getTypes/number.mjs";import s from"./utils/getTypes/people.mjs";import c from"./utils/getTypes/phone_number.mjs";import l from"./utils/getTypes/rich_text.mjs";import u from"./utils/getTypes/select.mjs";import d from"./utils/getTypes/title.mjs";import f from"./utils/getTypes/url.mjs";import{map as p,sortBy as m}from"lodash-es";const h=e=>e.type===`rollup`?e.rollup.type===`array`&&p(e.rollup.array,e=>_[e.type](e))[0]:p(e.relation,e=>e.id),g=e=>{let t=e?.rollup;return m(p(t?.array,e=>p(e[e?.type],t=>_[e?.type]({[e?.type]:[t],type:e?.type})))).flat()},_={checkbox:t,created_by:e,created_time:n,date:n,email:r,files:i,formula:e,image:i,last_edited_by:e,last_edited_time:n,multi_select:a,number:o,people:s,phone_number:c,relation:h,rich_text:l,rollup:g,select:u,title:d,url:f};export{g as n,h as r,_ as t};
2
+ //# sourceMappingURL=getTypes-Df5GL8wS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTypes-Df5GL8wS.mjs","names":["_map","_sortBy","_map"],"sources":["../src/utils/getTypes/relation.ts","../src/utils/getTypes/rollup.ts","../src/utils/getTypes/index.ts"],"sourcesContent":["import { map as _map } from 'lodash-es'\n\nimport getTypes from '../../utils/getTypes/index'\n\nconst relation = (data: any) => {\n if (data.type === 'rollup') {\n return (\n data.rollup.type === 'array' &&\n _map(data.rollup.array, (item: any) => {\n return getTypes[item.type](item)\n })[0]\n )\n } else {\n return _map(data.relation, (relation: any) => relation.id)\n }\n}\n\nexport default relation\n","import type { RollupFunction } from '../../schema/index'\n\nimport { map as _map, sortBy as _sortBy } from 'lodash-es'\n\nimport getTypes from '../../utils/getTypes/index'\n\n/**\n * @note(notion) https://github.com/JeromeFitz/packages/issues/631\n */\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype Rollup = {\n array: any\n function: RollupFunction\n type: 'array'\n}\n\n// @todo(types)\nconst rollup = (data: any) => {\n const rollupData: Rollup = data?.rollup\n return _sortBy(\n _map(rollupData?.array, (item) =>\n _map(item[item?.type], (itemData) =>\n getTypes[item?.type]({\n [item?.type]: [itemData],\n type: item?.type,\n }),\n ),\n ),\n ).flat()\n}\n\nexport default rollup\n","import _unsupported from './_unsupported'\nimport checkbox from './checkbox'\nimport date from './date'\nimport email from './email'\nimport files from './files'\n// import images from './images'\nimport multi_select from './multi_select'\nimport number from './number'\nimport people from './people'\nimport phone_number from './phone_number'\nimport relation from './relation'\nimport rich_text from './rich_text'\nimport rollup from './rollup'\nimport select from './select'\nimport title from './title'\nimport url from './url'\n\nconst getTypes = {\n checkbox,\n created_by: _unsupported,\n created_time: date,\n date,\n email,\n files,\n formula: _unsupported,\n image: files,\n last_edited_by: _unsupported,\n last_edited_time: date,\n multi_select,\n number,\n people,\n phone_number,\n relation,\n rich_text,\n rollup,\n select,\n title,\n url,\n}\n\nexport default getTypes\n"],"mappings":"0mBAIA,MAAM,EAAY,GACZ,EAAK,OAAS,SAEd,EAAK,OAAO,OAAS,SACrBA,EAAK,EAAK,OAAO,MAAQ,GAChB,EAAS,EAAK,MAAM,EAAK,CAChC,CAAC,GAGEA,EAAK,EAAK,SAAW,GAAkB,EAAS,GAAG,CCIxD,EAAU,GAAc,CAC5B,IAAM,EAAqB,GAAM,OACjC,OAAOC,EACLC,EAAK,GAAY,MAAQ,GACvBA,EAAK,EAAK,GAAM,MAAQ,GACtB,EAAS,GAAM,MAAM,EAClB,GAAM,MAAO,CAAC,EAAS,CACxB,KAAM,GAAM,KACb,CAAC,CACH,CACF,CACF,CAAC,MAAM,ECXJ,EAAW,CACf,WACA,WAAY,EACZ,aAAc,EACd,OACA,QACA,QACA,QAAS,EACT,MAAO,EACP,eAAgB,EAChB,iBAAkB,EAClB,eACA,SACA,SACA,eACA,WACA,YACA,SACA,SACA,QACA,MACD"}
@@ -242,4 +242,4 @@ interface Venue extends Default {
242
242
  type Venues = Record<string, Venue>;
243
243
  //#endregion
244
244
  export { Venue as A, RollupFunction as C, Shows as D, Show as E, SortItem as O, Rollup as S, SeoPost as T, People as _, DatabaseInfo as a, Podcasts as b, Direction as c, Event as d, Events as f, Pages as g, Page as h, DataTypesObject as i, Venues as j, SortMock as k, Episode as l, NotionText as m, BlogPost as n, DatabaseType as o, NotionBlock as p, DataTypes as r, Databases as s, Blog as t, Episodes as u, Person as v, Seo as w, Property as x, Podcast as y };
245
- //# sourceMappingURL=index-BnQkUs70.d.mts.map
245
+ //# sourceMappingURL=index-CvmUSReI.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BnQkUs70.d.mts","names":[],"sources":["../src/schema/index.ts"],"mappings":";KAAK,IAAA,GAAO,MAAA,SAAe,QAAA;AAAA,KAEtB,QAAA,GAAW,OAAA;AAAA,KACX,YAAA,GAAe,OAAA,CAClB,MAAA,CACE,YAAA;EAEE,MAAA;EACA,WAAA;EACA,SAAA,EAAW,SAAA;EAEX,QAAA;EACA,QAAA;EACA,OAAA;EACA,eAAA;EACA,IAAA;EACA,YAAA;EACA,SAAA;EACA,SAAA;EACA,eAAA;EACA,IAAA;EACA,GAAA;AAAA;AAAA,KAKD,SAAA,GAAY,MAAA,CAAO,YAAA,EAAc,YAAA;AAAA,KAEjC,YAAA;AA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EL,IAAA,SAAa,OAAA;EACrB,qBAAA;EACA,4BAAA;EACA,0BAAA;EACA,+BAAA;EACA,0BAAA;EACA,8BAAA;EACA,sCAAA;EACA,wCAAA;EACA,8BAAA;EACA,4BAAA;EACA,4BAAA;EACA,mBAAA;EACA,wBAAA;EACA,6BAAA;EACA,6BAAA;EACA,wBAAA;EACA,4BAAA;EACA,oCAAA;EACA,sCAAA;EACA,yBAAA;EACA,4BAAA;EACA,0BAAA;EACA,0BAAA;EACA,iBAAA;EACA,cAAA;EACA,eAAA;EACA,aAAA;EACA,aAAA;AAAA;AAAA,KAGG,KAAA,GAAQ,MAAA,SAAe,IAAA;AAAA,UAElB,QAAA;EACR,SAAA,EAAW,SAAA;EACX,QAAA;AAAA;AAAA,UAGQ,QAAA;EACR,MAAA;EACA,KAAA,EAAO,QAAA;AAAA;AAAA,UAGC,KAAA,SAAc,OAAA;EACtB,WAAA;EACA,eAAA;EACA,gBAAA;EACA,mBAAA;EACA,YAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;EACA,wBAAA;EACA,sBAAA;EACA,cAAA;EACA,eAAA;EACA,aAAA;EACA,aAAA;AAAA;AAAA,KAGG,MAAA,GAAS,MAAA,SAAe,KAAA"}
1
+ {"version":3,"file":"index-CvmUSReI.d.mts","names":[],"sources":["../src/schema/index.ts"],"mappings":";KAAK,IAAA,GAAO,MAAA,SAAe,QAAA;AAAA,KAEtB,QAAA,GAAW,OAAA;AAAA,KACX,YAAA,GAAe,OAAA,CAClB,MAAA,CACE,YAAA;EAEE,MAAA;EACA,WAAA;EACA,SAAA,EAAW,SAAA;EAEX,QAAA;EACA,QAAA;EACA,OAAA;EACA,eAAA;EACA,IAAA;EACA,YAAA;EACA,SAAA;EACA,SAAA;EACA,eAAA;EACA,IAAA;EACA,GAAA;AAAA;AAAA,KAKD,SAAA,GAAY,MAAA,CAAO,YAAA,EAAc,YAAA;AAAA,KAEjC,YAAA;AAAA,KAYA,SAAA;AAAA,KAEA,eAAA,GAAk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,4BAAA;EACA,0BAAA;EACA,+BAAA;EACA,0BAAA;EACA,8BAAA;EACA,sCAAA;EACA,wCAAA;EACA,8BAAA;EACA,4BAAA;EACA,4BAAA;EACA,mBAAA;EACA,wBAAA;EACA,6BAAA;EACA,6BAAA;EACA,wBAAA;EACA,4BAAA;EACA,oCAAA;EACA,sCAAA;EACA,yBAAA;EACA,4BAAA;EACA,0BAAA;EACA,0BAAA;EACA,iBAAA;EACA,cAAA;EACA,eAAA;EACA,aAAA;EACA,aAAA;AAAA;AAAA,KAGG,KAAA,GAAQ,MAAA,SAAe,IAAA;AAAA,UAElB,QAAA;EACR,SAAA,EAAW,SAAA;EACX,QAAA;AAAA;AAAA,UAGQ,QAAA;EACR,MAAA;EACA,KAAA,EAAO,QAAA;AAAA;AAAA,UAGC,KAAA,SAAc,OAAA;EACtB,WAAA;EACA,eAAA;EACA,gBAAA;EACA,mBAAA;EACA,YAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;EACA,wBAAA;EACA,sBAAA;EACA,cAAA;EACA,eAAA;EACA,aAAA;EACA,aAAA;AAAA;AAAA,KAGG,MAAA,GAAS,MAAA,SAAe,KAAA"}
package/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as DataTypes } from "./index-BnQkUs70.mjs";
1
+ import { r as DataTypes } from "./index-CvmUSReI.mjs";
2
2
  import { DATA_TYPES } from "./constants/index.mjs";
3
3
  import { Client as Client$1 } from "@notionhq/client";
4
4
 
package/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-pm2C21R4.mjs";import"./map-C4ZbQ-N0.mjs";import"./_baseProperty-D8FHbIgx.mjs";import{t as e}from"./constants-C5KahlYP.mjs";import t from"./queries/getBlocksByIdChildren/index.mjs";import n from"./queries/getDatabasesByIdQuery/index.mjs";import r from"./queries/getDeepFetchAllChildren/index.mjs";import i from"./queries/getInfoType/index.mjs";import"./utils-DGZbVKmT.mjs";import"./getTypes-B309tjVR.mjs";import"./getTitle-PyFbOk6t.mjs";import"./files-CS-BvFuw.mjs";import a from"./queries/getNotionListing/index.mjs";import o from"./queries/getNotionListingByDate/index.mjs";import s from"./queries/getNotionSlug/index.mjs";import c from"./queries/getNotionSlugByRoute/index.mjs";import l from"./queries/getPagesById/index.mjs";import{t as u}from"./getPathVariables-ffMiRvxv.mjs";import d from"./queries/getQuery/index.mjs";import"./queries/index.mjs";import{Client as f}from"@notionhq/client";var p=class extends f{#e;custom={getBlocksByIdChildren:async e=>await t({...e,getBlocksChildrenList:this.blocks.children.list}),getDatabasesByIdQuery:async e=>await n({...e,getDatabasesQuery:this.databases.query}),getDeepFetchAllChildren:async e=>await r({...e,getBlocksChildrenList:this.blocks.children.list}),getInfoType:e=>i({...e,config:this.#e}),getPagesById:async e=>await l({...e,getPagesRetrieve:this.pages.retrieve}),getPathVariables:e=>u({...e,config:this.#e}),getQuery:async e=>await d({...e,config:this.#e,notionDatabasesQuery:this.databases.query})};dataTypes={[e.LISTING]:async e=>await a({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById}),[e.LISTING_BY_DATE]:async e=>await o({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById}),[e.SLUG]:async e=>await s({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren}),[e.SLUG_BY_ROUTE]:async e=>await c({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery})};constructor(e){super(e),this.#e=e?.config}};export{p as Client};
1
+ import"./chunk-pm2C21R4.mjs";import{DATA_TYPES as e}from"./constants/index.mjs";import t from"./queries/getBlocksByIdChildren/index.mjs";import n from"./queries/getDatabasesByIdQuery/index.mjs";import r from"./queries/getDeepFetchAllChildren/index.mjs";import i from"./queries/getInfoType/index.mjs";import"./utils-bTlwvfkE.mjs";import"./getTypes-Df5GL8wS.mjs";import a from"./queries/getNotionListing/index.mjs";import o from"./queries/getNotionListingByDate/index.mjs";import s from"./queries/getNotionSlug/index.mjs";import c from"./queries/getNotionSlugByRoute/index.mjs";import l from"./queries/getPagesById/index.mjs";import u from"./queries/getPathVariables/index.mjs";import d from"./queries/getQuery/index.mjs";import"./queries/index.mjs";import{Client as f}from"@notionhq/client";var p=class extends f{#e;custom={getBlocksByIdChildren:async e=>await t({...e,getBlocksChildrenList:this.blocks.children.list}),getDatabasesByIdQuery:async e=>await n({...e,getDatabasesQuery:this.databases.query}),getDeepFetchAllChildren:async e=>await r({...e,getBlocksChildrenList:this.blocks.children.list}),getInfoType:e=>i({...e,config:this.#e}),getPagesById:async e=>await l({...e,getPagesRetrieve:this.pages.retrieve}),getPathVariables:e=>u({...e,config:this.#e}),getQuery:async e=>await d({...e,config:this.#e,notionDatabasesQuery:this.databases.query})};dataTypes={[e.LISTING]:async e=>await a({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById}),[e.LISTING_BY_DATE]:async e=>await o({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById}),[e.SLUG]:async e=>await s({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren}),[e.SLUG_BY_ROUTE]:async e=>await c({...e,config:this.#e,getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery})};constructor(e){super(e),this.#e=e?.config}};export{p as Client};
2
2
  //# sourceMappingURL=index.mjs.map
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_Client","#config"],"sources":["../src/index.ts"],"sourcesContent":["import { Client as _Client } from '@notionhq/client'\n\nimport { DATA_TYPES } from './constants/index'\nimport {\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getDeepFetchAllChildren,\n getInfoType,\n getNotionListing,\n getNotionListingByDate,\n getNotionSlug,\n getNotionSlugByRoute,\n getPagesById,\n getPathVariables,\n getQuery,\n} from './queries/index'\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype ClientProps = {\n custom: CustomProps\n dataTypes: DataTypesProps\n}\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype CredentialProps = {\n auth: string\n config: any\n}\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype CustomProps = {\n getBlocksByIdChildren: any\n getDatabasesByIdQuery: any\n getDeepFetchAllChildren: any\n getInfoType: any\n getPagesById: any\n getPathVariables: any\n getQuery: any\n}\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype DataTypesProps = {\n LISTING: any\n LISTING_BY_DATE: any\n SLUG: any\n SLUG_BY_ROUTE: any\n}\n\nclass Client extends _Client {\n #config?: any\n\n // @todo(notion) throw error if `config` is not passed\n public readonly custom = {\n getBlocksByIdChildren: async (props) =>\n await getBlocksByIdChildren({\n ...props,\n getBlocksChildrenList: this.blocks.children.list,\n }),\n\n getDatabasesByIdQuery: async (props) =>\n await getDatabasesByIdQuery({\n ...props,\n getDatabasesQuery: this.databases.query,\n }),\n\n getDeepFetchAllChildren: async (props) =>\n await getDeepFetchAllChildren({\n ...props,\n getBlocksChildrenList: this.blocks.children.list,\n }),\n\n getInfoType: (props) => {\n return getInfoType({ ...props, config: this.#config })\n },\n\n getPagesById: async (props) =>\n await getPagesById({ ...props, getPagesRetrieve: this.pages.retrieve }),\n\n getPathVariables: (props) =>\n getPathVariables({ ...props, config: this.#config }),\n\n getQuery: async (props) =>\n await getQuery({\n ...props,\n config: this.#config,\n notionDatabasesQuery: this.databases.query,\n }),\n }\n\n /**\n * @info details at: ../../utils/getDataType\n *\n */\n public readonly dataTypes = {\n [DATA_TYPES.LISTING]: async (props: {\n pathVariables: any\n routeType: any\n slug?: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.LISTING}`)\n return await getNotionListing({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getPagesById: this.custom.getPagesById,\n })\n },\n\n [DATA_TYPES.LISTING_BY_DATE]: async (props: {\n pathVariables: any\n routeType: any\n slug: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.LISTING_BY_DATE}`)\n return await getNotionListingByDate({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getPagesById: this.custom.getPagesById,\n })\n },\n\n [DATA_TYPES.SLUG]: async (props: {\n pathVariables: any\n routeType: any\n slug: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.SLUG}`)\n return await getNotionSlug({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getDeepFetchAllChildren: this.custom.getDeepFetchAllChildren,\n })\n },\n\n [DATA_TYPES.SLUG_BY_ROUTE]: async (props: {\n pathVariables: any\n routeType: any\n slug: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.SLUG_BY_ROUTE}`)\n return await getNotionSlugByRoute({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getQuery: this.custom.getQuery,\n })\n },\n }\n\n // public constructor(options?: ClientOptions) {\n public constructor(options?: any) {\n super(options)\n this.#config = options?.config\n }\n}\n\nexport type { ClientProps, CredentialProps }\nexport { Client }\n"],"mappings":"64BAgDA,IAAM,EAAN,cAAqBA,CAAQ,CAC3B,GAGA,OAAyB,CACvB,sBAAuB,KAAO,IAC5B,MAAM,EAAsB,CAC1B,GAAG,EACH,sBAAuB,KAAK,OAAO,SAAS,KAC7C,CAAC,CAEJ,sBAAuB,KAAO,IAC5B,MAAM,EAAsB,CAC1B,GAAG,EACH,kBAAmB,KAAK,UAAU,MACnC,CAAC,CAEJ,wBAAyB,KAAO,IAC9B,MAAM,EAAwB,CAC5B,GAAG,EACH,sBAAuB,KAAK,OAAO,SAAS,KAC7C,CAAC,CAEJ,YAAc,GACL,EAAY,CAAE,GAAG,EAAO,OAAQ,MAAA,EAAc,CAAC,CAGxD,aAAc,KAAO,IACnB,MAAM,EAAa,CAAE,GAAG,EAAO,iBAAkB,KAAK,MAAM,SAAU,CAAC,CAEzE,iBAAmB,GACjB,EAAiB,CAAE,GAAG,EAAO,OAAQ,MAAA,EAAc,CAAC,CAEtD,SAAU,KAAO,IACf,MAAM,EAAS,CACb,GAAG,EACH,OAAQ,MAAA,EACR,qBAAsB,KAAK,UAAU,MACtC,CAAC,CACL,CAMD,UAA4B,EACzB,EAAW,SAAU,KAAO,IAMpB,MAAM,EAAiB,CAC5B,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,aAAc,KAAK,OAAO,aAC3B,CAAC,EAGH,EAAW,iBAAkB,KAAO,IAM5B,MAAM,EAAuB,CAClC,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,aAAc,KAAK,OAAO,aAC3B,CAAC,EAGH,EAAW,MAAO,KAAO,IAMjB,MAAM,EAAc,CACzB,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,wBAAyB,KAAK,OAAO,wBACtC,CAAC,EAGH,EAAW,eAAgB,KAAO,IAM1B,MAAM,EAAqB,CAChC,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,SAAU,KAAK,OAAO,SACvB,CAAC,CAEL,CAGD,YAAmB,EAAe,CAChC,MAAM,EAAQ,CACd,MAAA,EAAe,GAAS"}
1
+ {"version":3,"file":"index.mjs","names":["_Client","#config"],"sources":["../src/index.ts"],"sourcesContent":["import { Client as _Client } from '@notionhq/client'\n\nimport { DATA_TYPES } from './constants/index'\nimport {\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getDeepFetchAllChildren,\n getInfoType,\n getNotionListing,\n getNotionListingByDate,\n getNotionSlug,\n getNotionSlugByRoute,\n getPagesById,\n getPathVariables,\n getQuery,\n} from './queries/index'\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype ClientProps = {\n custom: CustomProps\n dataTypes: DataTypesProps\n}\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype CredentialProps = {\n auth: string\n config: any\n}\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype CustomProps = {\n getBlocksByIdChildren: any\n getDatabasesByIdQuery: any\n getDeepFetchAllChildren: any\n getInfoType: any\n getPagesById: any\n getPathVariables: any\n getQuery: any\n}\n\n// biome-ignore lint/style/useConsistentTypeDefinitions: migrate\ntype DataTypesProps = {\n LISTING: any\n LISTING_BY_DATE: any\n SLUG: any\n SLUG_BY_ROUTE: any\n}\n\nclass Client extends _Client {\n #config?: any\n\n // @todo(notion) throw error if `config` is not passed\n public readonly custom = {\n getBlocksByIdChildren: async (props) =>\n await getBlocksByIdChildren({\n ...props,\n getBlocksChildrenList: this.blocks.children.list,\n }),\n\n getDatabasesByIdQuery: async (props) =>\n await getDatabasesByIdQuery({\n ...props,\n getDatabasesQuery: this.databases.query,\n }),\n\n getDeepFetchAllChildren: async (props) =>\n await getDeepFetchAllChildren({\n ...props,\n getBlocksChildrenList: this.blocks.children.list,\n }),\n\n getInfoType: (props) => {\n return getInfoType({ ...props, config: this.#config })\n },\n\n getPagesById: async (props) =>\n await getPagesById({ ...props, getPagesRetrieve: this.pages.retrieve }),\n\n getPathVariables: (props) =>\n getPathVariables({ ...props, config: this.#config }),\n\n getQuery: async (props) =>\n await getQuery({\n ...props,\n config: this.#config,\n notionDatabasesQuery: this.databases.query,\n }),\n }\n\n /**\n * @info details at: ../../utils/getDataType\n *\n */\n public readonly dataTypes = {\n [DATA_TYPES.LISTING]: async (props: {\n pathVariables: any\n routeType: any\n slug?: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.LISTING}`)\n return await getNotionListing({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getPagesById: this.custom.getPagesById,\n })\n },\n\n [DATA_TYPES.LISTING_BY_DATE]: async (props: {\n pathVariables: any\n routeType: any\n slug: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.LISTING_BY_DATE}`)\n return await getNotionListingByDate({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getPagesById: this.custom.getPagesById,\n })\n },\n\n [DATA_TYPES.SLUG]: async (props: {\n pathVariables: any\n routeType: any\n slug: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.SLUG}`)\n return await getNotionSlug({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getDeepFetchAllChildren: this.custom.getDeepFetchAllChildren,\n })\n },\n\n [DATA_TYPES.SLUG_BY_ROUTE]: async (props: {\n pathVariables: any\n routeType: any\n slug: any\n }) => {\n // console.dir(`📦️ [@jeromefitz/notion] => ${DATA_TYPES.SLUG_BY_ROUTE}`)\n return await getNotionSlugByRoute({\n ...props,\n config: this.#config,\n getBlocksByIdChildren: this.custom.getBlocksByIdChildren,\n getDatabasesByIdQuery: this.custom.getDatabasesByIdQuery,\n getQuery: this.custom.getQuery,\n })\n },\n }\n\n // public constructor(options?: ClientOptions) {\n public constructor(options?: any) {\n super(options)\n this.#config = options?.config\n }\n}\n\nexport type { ClientProps, CredentialProps }\nexport { Client }\n"],"mappings":"sxBAgDA,IAAM,EAAN,cAAqBA,CAAQ,CAC3B,GAGA,OAAyB,CACvB,sBAAuB,KAAO,IAC5B,MAAM,EAAsB,CAC1B,GAAG,EACH,sBAAuB,KAAK,OAAO,SAAS,KAC7C,CAAC,CAEJ,sBAAuB,KAAO,IAC5B,MAAM,EAAsB,CAC1B,GAAG,EACH,kBAAmB,KAAK,UAAU,MACnC,CAAC,CAEJ,wBAAyB,KAAO,IAC9B,MAAM,EAAwB,CAC5B,GAAG,EACH,sBAAuB,KAAK,OAAO,SAAS,KAC7C,CAAC,CAEJ,YAAc,GACL,EAAY,CAAE,GAAG,EAAO,OAAQ,MAAA,EAAc,CAAC,CAGxD,aAAc,KAAO,IACnB,MAAM,EAAa,CAAE,GAAG,EAAO,iBAAkB,KAAK,MAAM,SAAU,CAAC,CAEzE,iBAAmB,GACjB,EAAiB,CAAE,GAAG,EAAO,OAAQ,MAAA,EAAc,CAAC,CAEtD,SAAU,KAAO,IACf,MAAM,EAAS,CACb,GAAG,EACH,OAAQ,MAAA,EACR,qBAAsB,KAAK,UAAU,MACtC,CAAC,CACL,CAMD,UAA4B,EACzB,EAAW,SAAU,KAAO,IAMpB,MAAM,EAAiB,CAC5B,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,aAAc,KAAK,OAAO,aAC3B,CAAC,EAGH,EAAW,iBAAkB,KAAO,IAM5B,MAAM,EAAuB,CAClC,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,aAAc,KAAK,OAAO,aAC3B,CAAC,EAGH,EAAW,MAAO,KAAO,IAMjB,MAAM,EAAc,CACzB,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,wBAAyB,KAAK,OAAO,wBACtC,CAAC,EAGH,EAAW,eAAgB,KAAO,IAM1B,MAAM,EAAqB,CAChC,GAAG,EACH,OAAQ,MAAA,EACR,sBAAuB,KAAK,OAAO,sBACnC,sBAAuB,KAAK,OAAO,sBACnC,SAAU,KAAK,OAAO,SACvB,CAAC,CAEL,CAGD,YAAmB,EAAe,CAChC,MAAM,EAAQ,CACd,MAAA,EAAe,GAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeromefitz/notion",
3
- "version": "5.1.13-canary.3",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "description": "Notion: Custom Client for jeromefitzgerald.com",
6
6
  "repository": {
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@jeromefitz/utils": "^3.0.0",
79
- "lodash": "^4.17.21"
79
+ "lodash-es": "^4.17.21"
80
80
  },
81
81
  "dependencies": {
82
82
  "@notionhq/client": "4.0.2",
@@ -92,8 +92,5 @@
92
92
  "registry": "https://registry.npmjs.org/",
93
93
  "provenance": true
94
94
  },
95
- "sideEffects": false,
96
- "inlinedDependencies": {
97
- "lodash-es": "4.17.23"
98
- }
95
+ "sideEffects": false
99
96
  }
@@ -1,4 +1,4 @@
1
- import { O as SortItem } from "../../index-BnQkUs70.mjs";
1
+ import { O as SortItem } from "../../index-CvmUSReI.mjs";
2
2
 
3
3
  //#region src/queries/getDatabasesByIdQuery/index.d.ts
4
4
  declare const getDatabasesByIdQuery: ({
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import{i as e}from"../../constants-C5KahlYP.mjs";const t={sorts:[{direction:`ascending`,property:e.slug.notion}]},n=async({database_id:e,filter:n=t?.filter,getDatabasesQuery:r,sorts:i=t?.sorts})=>e?await r({database_id:e,filter:n,sorts:i}):[];export{n as default};
1
+ import"../../chunk-pm2C21R4.mjs";import{PROPERTIES as e}from"../../constants/index.mjs";const t={sorts:[{direction:`ascending`,property:e.slug.notion}]},n=async({database_id:e,filter:n=t?.filter,getDatabasesQuery:r,sorts:i=t?.sorts})=>e?await r({database_id:e,filter:n,sorts:i}):[];export{n as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getDatabasesByIdQuery/index.ts"],"sourcesContent":["import type { SortMock } from '../../schema/index'\n\nimport { PROPERTIES } from '../../constants/index'\n\nconst sortDefault: SortMock = {\n sorts: [\n {\n direction: 'ascending',\n property: PROPERTIES.slug.notion,\n },\n ],\n}\n\n// @todo(types)\nconst getDatabasesByIdQuery = async ({\n database_id,\n filter = sortDefault?.filter,\n getDatabasesQuery,\n sorts = sortDefault?.sorts,\n}) => {\n if (!database_id) return []\n return await getDatabasesQuery({\n database_id,\n filter,\n sorts,\n })\n}\n\nexport default getDatabasesByIdQuery\n"],"mappings":"0JAIA,MAAM,EAAwB,CAC5B,MAAO,CACL,CACE,UAAW,YACX,SAAU,EAAW,KAAK,OAC3B,CACF,CACF,CAGK,EAAwB,MAAO,CACnC,cACA,SAAS,GAAa,OACtB,oBACA,QAAQ,GAAa,SAEhB,EACE,MAAM,EAAkB,CAC7B,cACA,SACA,QACD,CAAC,CALuB,EAAE"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getDatabasesByIdQuery/index.ts"],"sourcesContent":["import type { SortMock } from '../../schema/index'\n\nimport { PROPERTIES } from '../../constants/index'\n\nconst sortDefault: SortMock = {\n sorts: [\n {\n direction: 'ascending',\n property: PROPERTIES.slug.notion,\n },\n ],\n}\n\n// @todo(types)\nconst getDatabasesByIdQuery = async ({\n database_id,\n filter = sortDefault?.filter,\n getDatabasesQuery,\n sorts = sortDefault?.sorts,\n}) => {\n if (!database_id) return []\n return await getDatabasesQuery({\n database_id,\n filter,\n sorts,\n })\n}\n\nexport default getDatabasesByIdQuery\n"],"mappings":"wFAIA,MAAM,EAAwB,CAC5B,MAAO,CACL,CACE,UAAW,YACX,SAAU,EAAW,KAAK,OAC3B,CACF,CACF,CAGK,EAAwB,MAAO,CACnC,cACA,SAAS,GAAa,OACtB,oBACA,QAAQ,GAAa,SAEhB,EACE,MAAM,EAAkB,CAC7B,cACA,SACA,QACD,CAAC,CALuB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListing/index.ts"],"mappings":";cAQM,gBAAA;EAA0B,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,YAAA;EAAA,aAAA;EAAA;AAAA;;;;;;;MAO/B,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListing/index.ts"],"mappings":";cAOM,gBAAA;EAA0B,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,YAAA;EAAA,aAAA;EAAA;AAAA;;;;;;;MAO/B,OAAA"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import{i as t}from"../../constants-C5KahlYP.mjs";import{n,r}from"../../utils-DGZbVKmT.mjs";import"../../getTypes-B309tjVR.mjs";import"../../getTitle-PyFbOk6t.mjs";import"../../files-CS-BvFuw.mjs";import{sortObject as i}from"@jeromefitz/utils";const a=async({config:a,getBlocksByIdChildren:o,getDatabasesByIdQuery:s,getPagesById:c,pathVariables:l,routeType:u})=>{let{NOTION:d}=a,f={},p=d[u.toUpperCase()].page_id__seo,m=await c({page_id:p});if(!m)return{};m?.object===`page`&&(f=r(m,`properties`),f.properties=i(n({config:a,data:m,pageId:f.id,pathVariables:l})));let h=d[u.toUpperCase()].infoType.notion??t.datePublished.notion,g=h===t.datePublished.notion?new Date(`2020-01-01`).toISOString():new Date().toISOString(),_=await o({block_id:f.id}),v=await s({database_id:d[u.toUpperCase()].database_id,filter:{and:[{date:{on_or_after:g},property:h}]}}),y=[];e(v.results,e=>{let t=e;t=r(t,`properties`),t.properties=i(n({config:a,data:e,pageId:e.id,pathVariables:l})),y.push(t)});let b=r(v,`results`);return b.results=y,{content:_,images:{},info:f,items:b}};export{a as default};
1
+ import"../../chunk-pm2C21R4.mjs";import{PROPERTIES as e}from"../../constants/index.mjs";import{n as t}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";import{map as n,omit as r}from"lodash-es";import{sortObject as i}from"@jeromefitz/utils";const a=async({config:a,getBlocksByIdChildren:o,getDatabasesByIdQuery:s,getPagesById:c,pathVariables:l,routeType:u})=>{let{NOTION:d}=a,f={},p=d[u.toUpperCase()].page_id__seo,m=await c({page_id:p});if(!m)return{};m?.object===`page`&&(f=r(m,`properties`),f.properties=i(t({config:a,data:m,pageId:f.id,pathVariables:l})));let h=d[u.toUpperCase()].infoType.notion??e.datePublished.notion,g=h===e.datePublished.notion?new Date(`2020-01-01`).toISOString():new Date().toISOString(),_=await o({block_id:f.id}),v=await s({database_id:d[u.toUpperCase()].database_id,filter:{and:[{date:{on_or_after:g},property:h}]}}),y=[];n(v.results,e=>{let n=e;n=r(n,`properties`),n.properties=i(t({config:a,data:e,pageId:e.id,pathVariables:l})),y.push(n)});let b=r(v,`results`);return b.results=y,{content:_,images:{},info:f,items:b}};export{a as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionListing/index.ts"],"sourcesContent":["import { sortObject } from '@jeromefitz/utils'\n\nimport _map from 'lodash-es/map'\nimport _omit from 'lodash-es/omit'\n\nimport { PROPERTIES } from '../../constants/index'\nimport { dataNormalized } from '../../utils/index'\n\nconst getNotionListing = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getPagesById,\n pathVariables,\n routeType,\n}) => {\n const { NOTION } = config\n\n let info: any = {}\n\n const page_id = NOTION[routeType.toUpperCase()].page_id__seo\n const _info = await getPagesById({\n page_id,\n })\n // @refactor(404)\n if (!_info) {\n return {}\n }\n if (_info?.object === 'page') {\n info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n }\n\n const property =\n NOTION[routeType.toUpperCase()].infoType.notion ??\n PROPERTIES.datePublished.notion\n\n /**\n * @todo Can we make the date dynamic?\n * This can be considered the date you want to go back in time to on build.\n * Can be construed as the website creation date, too I guess.\n *\n * For those routeTypes that do not go off of datePublished,\n * we want to get their listing by the current date.\n *\n * ex) /events => Only want events that are in the future.\n *\n */\n const timestamp =\n property === PROPERTIES.datePublished.notion\n ? new Date('2020-01-01').toISOString()\n : new Date().toISOString()\n\n const content = await getBlocksByIdChildren({ block_id: info.id })\n const _items: any = await getDatabasesByIdQuery({\n database_id: NOTION[routeType.toUpperCase()].database_id,\n filter: {\n and: [\n {\n date: {\n on_or_after: timestamp,\n },\n property,\n },\n ],\n },\n })\n const results: any[] = []\n _map(_items.results, (item) => {\n let itemInit = item\n itemInit = _omit(itemInit, 'properties')\n itemInit.properties = sortObject(\n dataNormalized({ config, data: item, pageId: item.id, pathVariables }),\n )\n results.push(itemInit)\n // console.dir(`> last_edited_time`)\n // console.dir(item.id)\n // console.dir(item.last_edited_time)\n // console.dir(`---`)\n })\n const items = _omit(_items, 'results')\n items.results = results\n\n /**\n * @note(plaiceholder)\n *\n * Pass empty `images` object for SSR/API takeover\n */\n return { content, images: {}, info, items }\n}\n\nexport default getNotionListing\n"],"mappings":"wWAQA,MAAM,EAAmB,MAAO,CAC9B,SACA,wBACA,wBACA,eACA,gBACA,eACI,CACJ,GAAM,CAAE,UAAW,EAEf,EAAY,EAAE,CAEZ,EAAU,EAAO,EAAU,aAAa,EAAE,aAC1C,EAAQ,MAAM,EAAa,CAC/B,UACD,CAAC,CAEF,GAAI,CAAC,EACH,MAAO,EAAE,CAEP,GAAO,SAAW,SACpB,EAAOA,EAAM,EAAO,aAAa,CACjC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACxE,EAGH,IAAM,EACJ,EAAO,EAAU,aAAa,EAAE,SAAS,QACzC,EAAW,cAAc,OAarB,EACJ,IAAa,EAAW,cAAc,OAClC,IAAI,KAAK,aAAa,CAAC,aAAa,CACpC,IAAI,MAAM,CAAC,aAAa,CAExB,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,CAC5D,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,aAAa,EAAE,YAC7C,OAAQ,CACN,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EACd,CACD,WACD,CACF,CACF,CACF,CAAC,CACI,EAAiB,EAAE,CACzB,EAAK,EAAO,QAAU,GAAS,CAC7B,IAAI,EAAW,EACf,EAAWA,EAAM,EAAU,aAAa,CACxC,EAAS,WAAa,EACpB,EAAe,CAAE,SAAQ,KAAM,EAAM,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACvE,CACD,EAAQ,KAAK,EAAS,EAKtB,CACF,IAAM,EAAQA,EAAM,EAAQ,UAAU,CAQtC,MAPA,GAAM,QAAU,EAOT,CAAE,UAAS,OAAQ,EAAE,CAAE,OAAM,QAAO"}
1
+ {"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionListing/index.ts"],"sourcesContent":["import { sortObject } from '@jeromefitz/utils'\n\nimport { map as _map, omit as _omit } from 'lodash-es'\n\nimport { PROPERTIES } from '../../constants/index'\nimport { dataNormalized } from '../../utils/index'\n\nconst getNotionListing = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getPagesById,\n pathVariables,\n routeType,\n}) => {\n const { NOTION } = config\n\n let info: any = {}\n\n const page_id = NOTION[routeType.toUpperCase()].page_id__seo\n const _info = await getPagesById({\n page_id,\n })\n // @refactor(404)\n if (!_info) {\n return {}\n }\n if (_info?.object === 'page') {\n info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n }\n\n const property =\n NOTION[routeType.toUpperCase()].infoType.notion ??\n PROPERTIES.datePublished.notion\n\n /**\n * @todo Can we make the date dynamic?\n * This can be considered the date you want to go back in time to on build.\n * Can be construed as the website creation date, too I guess.\n *\n * For those routeTypes that do not go off of datePublished,\n * we want to get their listing by the current date.\n *\n * ex) /events => Only want events that are in the future.\n *\n */\n const timestamp =\n property === PROPERTIES.datePublished.notion\n ? new Date('2020-01-01').toISOString()\n : new Date().toISOString()\n\n const content = await getBlocksByIdChildren({ block_id: info.id })\n const _items: any = await getDatabasesByIdQuery({\n database_id: NOTION[routeType.toUpperCase()].database_id,\n filter: {\n and: [\n {\n date: {\n on_or_after: timestamp,\n },\n property,\n },\n ],\n },\n })\n const results: any[] = []\n _map(_items.results, (item) => {\n let itemInit = item\n itemInit = _omit(itemInit, 'properties')\n itemInit.properties = sortObject(\n dataNormalized({ config, data: item, pageId: item.id, pathVariables }),\n )\n results.push(itemInit)\n // console.dir(`> last_edited_time`)\n // console.dir(item.id)\n // console.dir(item.last_edited_time)\n // console.dir(`---`)\n })\n const items = _omit(_items, 'results')\n items.results = results\n\n /**\n * @note(plaiceholder)\n *\n * Pass empty `images` object for SSR/API takeover\n */\n return { content, images: {}, info, items }\n}\n\nexport default getNotionListing\n"],"mappings":"kQAOA,MAAM,EAAmB,MAAO,CAC9B,SACA,wBACA,wB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AAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"mappings":";cAoIM,sBAAA;EAAgC,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,YAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQrC,OAAA"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import{i as t,o as n}from"../../constants-C5KahlYP.mjs";import{n as r,r as i}from"../../utils-DGZbVKmT.mjs";import"../../getTypes-B309tjVR.mjs";import"../../getTitle-PyFbOk6t.mjs";import a from"../../utils/addTime/index.mjs";import{n as o}from"../../files-CS-BvFuw.mjs";import{sortObject as s}from"@jeromefitz/utils";const c=({config:e,pathVariables:r,routeType:i,slug:s})=>{let{NOTION:c}=e,{meta:l}=r,[u,d,f]=l,p=o(l),m=new Date().toISOString(),h=new Date(`${u||m.slice(0,4)}-${d||`01`}-${f||`01`}`),g=c[i.toUpperCase()]?.infoType?.notion??t.datePublished.notion;switch(p){case 1:return{and:[{date:{on_or_after:a(h,``)},property:g},{date:{before:a(h,`year`)},property:g}]};case 2:return{and:[{date:{on_or_after:a(h,``)},property:g},{date:{before:a(h,`month`)},property:g}]};case 3:return{and:[{date:{on_or_after:a(h,``)},property:g},{date:{before:a(h,`day`)},property:g}]};default:return{and:[{date:{on_or_after:a(h,``)},property:g},{date:{before:a(h,`day`)},property:g},{...n.slug,rich_text:{equals:s}}]}}},l=async({config:n,getBlocksByIdChildren:a,getDatabasesByIdQuery:o,getPagesById:l,pathVariables:u,routeType:d,slug:f})=>{let{NOTION:p}=n,m={},h={},g=p[d.toUpperCase()].page_id__seo,_=await l({page_id:g});_.object===`page`&&(h=i(_,`properties`),h.properties=s(r({config:n,data:_,pageId:_.id,pathVariables:u}))),m=await a({block_id:h.id});let v=[{direction:`descending`,property:t.datePublished.notion}],y=c({config:n,pathVariables:u,routeType:d,slug:f}),b=p[d.toUpperCase()].database_id,x=await o({database_id:b,filter:y,sorts:v}),S=[];e(x.results,e=>{let t=i(e,`properties`);t.properties=s(r({config:n,data:e,pageId:t.id,pathVariables:u})),t&&S.push(t)});let C=i(x,`results`);C.results=S;let w=i(C,`data`);return{content:m,images:{},info:h,items:w}};export{l as default};
1
+ import"../../chunk-pm2C21R4.mjs";import{PROPERTIES as e,QUERIES as t}from"../../constants/index.mjs";import n from"../../utils/addTime/index.mjs";import{n as r}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";import{map as i,omit as a,size as o}from"lodash-es";import{sortObject as s}from"@jeromefitz/utils";const c=({config:r,pathVariables:i,routeType:a,slug:s})=>{let{NOTION:c}=r,{meta:l}=i,[u,d,f]=l,p=o(l),m=new Date().toISOString(),h=new Date(`${u||m.slice(0,4)}-${d||`01`}-${f||`01`}`),g=c[a.toUpperCase()]?.infoType?.notion??e.datePublished.notion;switch(p){case 1:return{and:[{date:{on_or_after:n(h,``)},property:g},{date:{before:n(h,`year`)},property:g}]};case 2:return{and:[{date:{on_or_after:n(h,``)},property:g},{date:{before:n(h,`month`)},property:g}]};case 3:return{and:[{date:{on_or_after:n(h,``)},property:g},{date:{before:n(h,`day`)},property:g}]};default:return{and:[{date:{on_or_after:n(h,``)},property:g},{date:{before:n(h,`day`)},property:g},{...t.slug,rich_text:{equals:s}}]}}},l=async({config:t,getBlocksByIdChildren:n,getDatabasesByIdQuery:o,getPagesById:l,pathVariables:u,routeType:d,slug:f})=>{let{NOTION:p}=t,m={},h={},g=p[d.toUpperCase()].page_id__seo,_=await l({page_id:g});_.object===`page`&&(h=a(_,`properties`),h.properties=s(r({config:t,data:_,pageId:_.id,pathVariables:u}))),m=await n({block_id:h.id});let v=[{direction:`descending`,property:e.datePublished.notion}],y=c({config:t,pathVariables:u,routeType:d,slug:f}),b=p[d.toUpperCase()].database_id,x=await o({database_id:b,filter:y,sorts:v}),S=[];i(x.results,e=>{let n=a(e,`properties`);n.properties=s(r({config:t,data:e,pageId:n.id,pathVariables:u})),n&&S.push(n)});let C=a(x,`results`);C.results=S;let w=a(C,`data`);return{content:m,images:{},info:h,items:w}};export{l as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"sourcesContent":["import type { SortItem } from '../../schema/index'\n\nimport { sortObject } from '@jeromefitz/utils'\n\nimport _map from 'lodash-es/map'\nimport _omit from 'lodash-es/omit'\nimport _size from 'lodash-es/size'\n\nimport { PROPERTIES, QUERIES } from '../../constants/index'\nimport { addTime, dataNormalized } from '../../utils/index'\n\nconst getNotionListingByDate__getFilter = ({\n config,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION } = config\n const { meta } = pathVariables\n const [year, month, day] = meta\n const metaCount = _size(meta)\n // @hack nothing to see here, haha\n const dateTimestamp = new Date().toISOString()\n const timestampQuery = new Date(\n `${year ? year : dateTimestamp.slice(0, 4)}-${month ? month : '01'}-${\n day ? day : '01'\n }`,\n )\n\n /**\n * @filter\n * @note metaCount breakdown:\n * 1 = yyyy\n * 2 = yyyy/mm\n * 3 = yyyy/mm/dd\n * ? = yyyy/mm/dd/slug (SLUG_BY_ROUTE takes this over)\n */\n const property =\n NOTION[routeType.toUpperCase()]?.infoType?.notion ??\n PROPERTIES.datePublished.notion\n\n switch (metaCount) {\n /**\n * @note yyyy\n */\n case 1:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'year'),\n },\n property,\n },\n ],\n }\n\n /**\n * @note yyyy/mm\n */\n case 2:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'month'),\n },\n property,\n },\n ],\n }\n\n /**\n * @note yyyy/mm/dd\n */\n case 3:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'day'),\n },\n property,\n },\n ],\n }\n\n /**\n * @note yyyy/mm/dd/slug\n *\n * Technically this is picked up by `getNotionSlugByRoute` SLUG_BY_ROUTE\n */\n default:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'day'),\n },\n property,\n },\n {\n ...QUERIES.slug,\n rich_text: { equals: slug },\n },\n ],\n }\n }\n}\n\nconst getNotionListingByDate = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getPagesById,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION } = config\n\n let content: any = {},\n info: any = {}\n\n const page_id = NOTION[routeType.toUpperCase()].page_id__seo\n const _info = await getPagesById({\n page_id,\n })\n if (_info.object === 'page') {\n info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: _info.id, pathVariables }),\n )\n }\n\n content = await getBlocksByIdChildren({ block_id: info.id })\n\n const sorts: SortItem[] = [\n {\n direction: 'descending',\n property: PROPERTIES.datePublished.notion,\n },\n ]\n const filter = getNotionListingByDate__getFilter({\n config,\n pathVariables,\n routeType,\n slug,\n })\n\n const database_id = NOTION[routeType.toUpperCase()].database_id\n\n const ___items: any = await getDatabasesByIdQuery({\n database_id,\n filter,\n sorts,\n })\n const __items: any[] = []\n _map(___items.results, (i) => {\n const item = _omit(i, 'properties')\n item.properties = sortObject(\n dataNormalized({ config, data: i, pageId: item.id, pathVariables }),\n )\n !!item && __items.push(item)\n })\n const _items = _omit(___items, 'results')\n _items.results = __items\n const items = _omit(_items, 'data')\n\n /**\n * @note(plaiceholder)\n *\n * Pass empty `images` object for SSR/API takeover\n */\n return { content, images: {}, info, items }\n}\n\nexport default getNotionListingByDate\n"],"mappings":"kbAWA,MAAM,GAAqC,CACzC,SACA,gBACA,YACA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C,EAAQ,MAAM,EAAa,CAC/B,UACD,CAAC,CACE,EAAM,SAAW,SACnB,EAAOC,EAAM,EAAO,aAAa,CACjC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAM,GAAI,gBAAe,CAAC,CACzE,EAGH,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,CAE5D,IAAM,EAAoB,CACxB,CACE,UAAW,aACX,SAAU,EAAW,cAAc,OACpC,CACF,CACK,EAAS,EAAkC,CAC/C,SACA,gBACA,YACA,OACD,CAAC,CAEI,EAAc,EAAO,EAAU,aAAa,EAAE,YAE9C,EAAgB,MAAM,EAAsB,CAChD,cACA,SACA,QACD,CAAC,CACI,EAAiB,EAAE,CACzB,EAAK,EAAS,QAAU,GAAM,CAC5B,IAAM,EAAOA,EAAM,EAAG,aAAa,CACnC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAG,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACpE,CACC,GAAQ,EAAQ,KAAK,EAAK,EAC5B,CACF,IAAM,EAASA,EAAM,EAAU,UAAU,CACzC,EAAO,QAAU,EACjB,IAAM,EAAQA,EAAM,EAAQ,OAAO,CAOnC,MAAO,CAAE,UAAS,OAAQ,EAAE,CAAE,OAAM,QAAO"}
1
+ {"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"sourcesContent":["import type { SortItem } from '../../schema/index'\n\nimport { sortObject } from '@jeromefitz/utils'\n\nimport { map as _map, omit as _omit, size as _size } from 'lodash-es'\n\nimport { PROPERTIES, QUERIES } from '../../constants/index'\nimport { addTime, dataNormalized } from '../../utils/index'\n\nconst getNotionListingByDate__getFilter = ({\n config,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION } = config\n const { meta } = pathVariables\n const [year, month, day] = meta\n const metaCount = _size(meta)\n // @hack nothing to see here, haha\n const dateTimestamp = new Date().toISOString()\n const timestampQuery = new Date(\n `${year ? year : dateTimestamp.slice(0, 4)}-${month ? month : '01'}-${\n day ? day : '01'\n }`,\n )\n\n /**\n * @filter\n * @note metaCount breakdown:\n * 1 = yyyy\n * 2 = yyyy/mm\n * 3 = yyyy/mm/dd\n * ? = yyyy/mm/dd/slug (SLUG_BY_ROUTE takes this over)\n */\n const property =\n NOTION[routeType.toUpperCase()]?.infoType?.notion ??\n PROPERTIES.datePublished.notion\n\n switch (metaCount) {\n /**\n * @note yyyy\n */\n case 1:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'year'),\n },\n property,\n },\n ],\n }\n\n /**\n * @note yyyy/mm\n */\n case 2:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'month'),\n },\n property,\n },\n ],\n }\n\n /**\n * @note yyyy/mm/dd\n */\n case 3:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'day'),\n },\n property,\n },\n ],\n }\n\n /**\n * @note yyyy/mm/dd/slug\n *\n * Technically this is picked up by `getNotionSlugByRoute` SLUG_BY_ROUTE\n */\n default:\n return {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'day'),\n },\n property,\n },\n {\n ...QUERIES.slug,\n rich_text: { equals: slug },\n },\n ],\n }\n }\n}\n\nconst getNotionListingByDate = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getPagesById,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION } = config\n\n let content: any = {},\n info: any = {}\n\n const page_id = NOTION[routeType.toUpperCase()].page_id__seo\n const _info = await getPagesById({\n page_id,\n })\n if (_info.object === 'page') {\n info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: _info.id, pathVariables }),\n )\n }\n\n content = await getBlocksByIdChildren({ block_id: info.id })\n\n const sorts: SortItem[] = [\n {\n direction: 'descending',\n property: PROPERTIES.datePublished.notion,\n },\n ]\n const filter = getNotionListingByDate__getFilter({\n config,\n pathVariables,\n routeType,\n slug,\n })\n\n const database_id = NOTION[routeType.toUpperCase()].database_id\n\n const ___items: any = await getDatabasesByIdQuery({\n database_id,\n filter,\n sorts,\n })\n const __items: any[] = []\n _map(___items.results, (i) => {\n const item = _omit(i, 'properties')\n item.properties = sortObject(\n dataNormalized({ config, data: i, pageId: item.id, pathVariables }),\n )\n !!item && __items.push(item)\n })\n const _items = _omit(___items, 'results')\n _items.results = __items\n const items = _omit(_items, 'data')\n\n /**\n * @note(plaiceholder)\n *\n * Pass empty `images` object for SSR/API takeover\n */\n return { content, images: {}, info, items }\n}\n\nexport default getNotionListingByDate\n"],"mappings":"sUASA,MAAM,GAAqC,CACzC,SACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EACb,CAAE,QAAS,EACX,CAAC,EAAM,EAAO,GAAO,EACrB,EAAYA,EAAM,EAAK,CAEvB,EAAgB,IAAI,MAAM,CAAC,aAAa,CACxC,EAAiB,IAAI,KACzB,GAAG,GAAc,EAAc,MAAM,EAAG,EAAE,CAAC,GAAG,GAAgB,KAAK,GACjE,GAAY,OAEf,CAUK,EACJ,EAAO,EAAU,aAAa,GAAG,UAAU,QAC3C,EAAW,cAAc,OAE3B,OAAQ,EAAR,CAIE,IAAK,GACH,MAAO,CACL,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,GAAG,CACzC,CACD,WACD,CACD,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,OAAO,CACxC,CACD,WACD,CACF,CACF,CAKH,IAAK,GACH,MAAO,CACL,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,GAAG,CACzC,CACD,WACD,CACD,CACE,KAAM,CACJ,OAAQ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,CACpE,CACC,GAAQ,EAAQ,KAAK,EAAK,EAC5B,CACF,IAAM,EAASA,EAAM,EAAU,UAAU,CACzC,EAAO,QAAU,EACjB,IAAM,EAAQA,EAAM,EAAQ,OAAO,CAOnC,MAAO,CAAE,UAAS,OAAQ,EAAE,CAAE,OAAM,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlug/index.ts"],"mappings":";cAQM,aAAA;EAAuB,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,uBAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQ5B,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlug/index.ts"],"mappings":";cAOM,aAAA;EAAuB,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,uBAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQ5B,OAAA"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import{o as e}from"../../constants-C5KahlYP.mjs";import{n as t,r as n}from"../../utils-DGZbVKmT.mjs";import"../../getTypes-B309tjVR.mjs";import"../../getTitle-PyFbOk6t.mjs";import"../../files-CS-BvFuw.mjs";import{sortObject as r}from"@jeromefitz/utils";const i=async({config:i,getBlocksByIdChildren:a,getDatabasesByIdQuery:o,getDeepFetchAllChildren:s,pathVariables:c,routeType:l,slug:u})=>{let{NOTION:d}=i,f=l?.toUpperCase();if(!Object.keys(d).includes(f))return{content:{},images:{},info:{},items:{}};let p=await o({database_id:d[f].database_id,filter:{and:[{...e.slug,rich_text:{equals:u}}]}}),m=p?.object===`list`&&p.results[0];if(!m)return{};let h=n(m,`properties`);return h.properties=r(t({config:i,data:m,pageId:h.id,pathVariables:c})),{content:[...await s({blocks:(await a({block_id:h.id})).results})],images:{},info:h,items:{}}};export{i as default};
1
+ import"../../chunk-pm2C21R4.mjs";import{QUERIES as e}from"../../constants/index.mjs";import{n as t}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";import{omit as n}from"lodash-es";import{sortObject as r}from"@jeromefitz/utils";const i=async({config:i,getBlocksByIdChildren:a,getDatabasesByIdQuery:o,getDeepFetchAllChildren:s,pathVariables:c,routeType:l,slug:u})=>{let{NOTION:d}=i,f=l?.toUpperCase();if(!Object.keys(d).includes(f))return{content:{},images:{},info:{},items:{}};let p=await o({database_id:d[f].database_id,filter:{and:[{...e.slug,rich_text:{equals:u}}]}}),m=p?.object===`list`&&p.results[0];if(!m)return{};let h=n(m,`properties`);return h.properties=r(t({config:i,data:m,pageId:h.id,pathVariables:c})),{content:[...await s({blocks:(await a({block_id:h.id})).results})],images:{},info:h,items:{}}};export{i as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionSlug/index.ts"],"sourcesContent":["// import _filter from 'lodash-es/filter'\nimport { sortObject } from '@jeromefitz/utils'\n\nimport _omit from 'lodash-es/omit'\n\nimport { QUERIES } from '../../constants/index'\nimport { dataNormalized } from '../../utils/index'\n\nconst getNotionSlug = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getDeepFetchAllChildren,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION } = config\n\n const DB_TYPE = routeType?.toUpperCase()\n const isValid = Object.keys(NOTION).includes(DB_TYPE)\n\n if (!isValid) return { content: {}, images: {}, info: {}, items: {} }\n\n const __info: any = await getDatabasesByIdQuery({\n database_id: NOTION[DB_TYPE].database_id,\n filter: {\n and: [\n {\n ...QUERIES.slug,\n rich_text: { equals: slug },\n },\n ],\n },\n })\n\n const _info = __info?.object === 'list' && __info.results[0]\n // @refactor(404)\n if (!_info) {\n return {}\n }\n\n const info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n\n const _content = await getBlocksByIdChildren({ block_id: info.id })\n const blocks = [...(await getDeepFetchAllChildren({ blocks: _content.results }))]\n const content = blocks\n\n /**\n * @question if this is reached, there are no `items`\n */\n // const items: any = {}\n // items.results = _filter(items?.results, { properties: { isPublished: true } })\n\n /**\n * @note(plaiceholder)\n *\n * Pass empty `images` object for SSR/API takeover\n */\n return { content, images: {}, info, items: {} }\n}\n\nexport default getNotionSlug\n"],"mappings":"sWAQA,MAAM,EAAgB,MAAO,CAC3B,SACA,wBACA,wBACA,0BACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EAEb,EAAU,GAAW,aAAa,CAGxC,GAAI,CAFY,OAAO,KAAK,EAAO,CAAC,SAAS,EAAQ,CAEvC,MAAO,CAAE,QAAS,EAAE,CAAE,OAAQ,EAAE,CAAE,KAAM,EAAE,CAAE,MAAO,EAAE,CAAE,CAErE,IAAM,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,GAAS,YAC7B,OAAQ,CACN,IAAK,CACH,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,EAAM,CAC5B,CACF,CACF,CACF,CAAC,CAEI,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,EAAE,CAGX,IAAM,EAAOA,EAAM,EAAO,aAAa,CAoBvC,MAnBA,GAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACxE,CAiBM,CAAE,QAdM,CAAC,GAAI,MAAM,EAAwB,CAAE,QADnC,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,EACE,QAAS,CAAC,CAAE,CAc/D,OAAQ,EAAE,CAAE,OAAM,MAAO,EAAE,CAAE"}
1
+ {"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionSlug/index.ts"],"sourcesContent":["import { sortObject } from '@jeromefitz/utils'\n\nimport { omit as _omit } from 'lodash-es'\n\nimport { QUERIES } from '../../constants/index'\nimport { dataNormalized } from '../../utils/index'\n\nconst getNotionSlug = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getDeepFetchAllChildren,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION } = config\n\n const DB_TYPE = routeType?.toUpperCase()\n const isValid = Object.keys(NOTION).includes(DB_TYPE)\n\n if (!isValid) return { content: {}, images: {}, info: {}, items: {} }\n\n const __info: any = await getDatabasesByIdQuery({\n database_id: NOTION[DB_TYPE].database_id,\n filter: {\n and: [\n {\n ...QUERIES.slug,\n rich_text: { equals: slug },\n },\n ],\n },\n })\n\n const _info = __info?.object === 'list' && __info.results[0]\n // @refactor(404)\n if (!_info) {\n return {}\n }\n\n const info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n\n const _content = await getBlocksByIdChildren({ block_id: info.id })\n const blocks = [...(await getDeepFetchAllChildren({ blocks: _content.results }))]\n const content = blocks\n\n /**\n * @question if this is reached, there are no `items`\n */\n // const items: any = {}\n // items.results = _filter(items?.results, { properties: { isPublished: true } })\n\n /**\n * @note(plaiceholder)\n *\n * Pass empty `images` object for SSR/API takeover\n */\n return { content, images: {}, info, items: {} }\n}\n\nexport default getNotionSlug\n"],"mappings":"sPAOA,MAAM,EAAgB,MAAO,CAC3B,SACA,wBACA,wBACA,0BACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EAEb,EAAU,GAAW,aAAa,CAGxC,GAAI,CAFY,OAAO,KAAK,EAAO,CAAC,SAAS,EAAQ,CAEvC,MAAO,CAAE,QAAS,EAAE,CAAE,OAAQ,EAAE,CAAE,KAAM,EAAE,CAAE,MAAO,EAAE,CAAE,CAErE,IAAM,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,GAAS,YAC7B,OAAQ,CACN,IAAK,CACH,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,EAAM,CAC5B,CACF,CACF,CACF,CAAC,CAEI,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,EAAE,CAGX,IAAM,EAAOA,EAAM,EAAO,aAAa,CAoBvC,MAnBA,GAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACxE,CAiBM,CAAE,QAdM,CAAC,GAAI,MAAM,EAAwB,CAAE,QADnC,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,EACE,QAAS,CAAC,CAAE,CAc/D,OAAQ,EAAE,CAAE,OAAM,MAAO,EAAE,CAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"mappings":";cA8JM,oBAAA;EAA8B,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,QAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQnC,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"mappings":";cA6JM,oBAAA;EAA8B,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,QAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQnC,OAAA"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import{i as e,o as t,t as n}from"../../constants-C5KahlYP.mjs";import{n as r,r as i}from"../../utils-DGZbVKmT.mjs";import"../../getTypes-B309tjVR.mjs";import"../../getTitle-PyFbOk6t.mjs";import a from"../../utils/addTime/index.mjs";import{n as o}from"../../files-CS-BvFuw.mjs";import{sortObject as s}from"@jeromefitz/utils";const c=async({config:e,getBlocksByIdChildren:n,getDatabasesByIdQuery:a,getQuery:c,pathVariables:l,routeType:u})=>{let{NOTION:d}=e,{meta:f}=l,p=u.toUpperCase(),[m,h]=f,g=o(f)===2,_=d[p]?.hasChild?.toUpperCase(),v=await a({database_id:d[g?d[_].routeType.toUpperCase():p].database_id,filter:{and:[{...t.slug,rich_text:{equals:g?h:m}}]}}),y=v?.object===`list`&&v.results[0];if(!y)return{content:{},images:{},info:{},items:{}};let b=i(y,`properties`);b.properties=s(r({config:e,data:y,pageId:b.id,pathVariables:l}));let x=await n({block_id:b.id}),S={};return g||(S=await c({config:e,reqQuery:{databaseType:d[_].routeType.toUpperCase(),podcasts:b.id}})),{content:x,images:{},info:b,items:S}},l=async({config:n,getBlocksByIdChildren:o,getDatabasesByIdQuery:c,pathVariables:l,routeType:u,slug:d})=>{let f=new Date().toISOString(),{NOTION:p}=n,{meta:m}=l,[h,g,_]=m,v=new Date(`${h||f.slice(0,4)}-${g||`01`}-${_||`01`}`),y=p[u.toUpperCase()]?.infoType?.notion??e.datePublished.notion,b=await c({database_id:p[u.toUpperCase()].database_id,filter:{and:[{date:{on_or_after:a(v,``)},property:y},{date:{before:a(v,`day`)},property:y},{...t.slug,rich_text:{equals:d}}]}}),x=b?.object===`list`&&b.results[0];if(!x)return{content:{},images:{},info:{},items:{}};let S=i(x,`properties`);return S.properties=s(r({config:n,data:x,pageId:S.id,pathVariables:l})),{content:await o({block_id:S.id}),images:{},info:S,items:{}}},u=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:r,getQuery:i,pathVariables:a,routeType:o,slug:s})=>{let{NOTION:u,ROUTE_TYPES_BY_DATA_TYPES:d}=e;return u[o?.toUpperCase()]?.hasChild?await c({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:r,getQuery:i,pathVariables:a,routeType:o}):d[n.LISTING_BY_DATE].includes(o.toUpperCase())?await l({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:r,pathVariables:a,routeType:o,slug:s}):{content:{},images:{},info:{},items:{}}};export{u as default};
1
+ import"../../chunk-pm2C21R4.mjs";import{DATA_TYPES as e,PROPERTIES as t,QUERIES as n}from"../../constants/index.mjs";import r from"../../utils/addTime/index.mjs";import{n as i}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";import{omit as a,size as o}from"lodash-es";import{sortObject as s}from"@jeromefitz/utils";const c=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:r,getQuery:c,pathVariables:l,routeType:u})=>{let{NOTION:d}=e,{meta:f}=l,p=u.toUpperCase(),[m,h]=f,g=o(f)===2,_=d[p]?.hasChild?.toUpperCase(),v=await r({database_id:d[g?d[_].routeType.toUpperCase():p].database_id,filter:{and:[{...n.slug,rich_text:{equals:g?h:m}}]}}),y=v?.object===`list`&&v.results[0];if(!y)return{content:{},images:{},info:{},items:{}};let b=a(y,`properties`);b.properties=s(i({config:e,data:y,pageId:b.id,pathVariables:l}));let x=await t({block_id:b.id}),S={};return g||(S=await c({config:e,reqQuery:{databaseType:d[_].routeType.toUpperCase(),podcasts:b.id}})),{content:x,images:{},info:b,items:S}},l=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:c,pathVariables:l,routeType:u,slug:d})=>{let f=new Date().toISOString(),{NOTION:p}=e,{meta:m}=l,[h,g,_]=m,v=new Date(`${h||f.slice(0,4)}-${g||`01`}-${_||`01`}`),y=p[u.toUpperCase()]?.infoType?.notion??t.datePublished.notion,b=await c({database_id:p[u.toUpperCase()].database_id,filter:{and:[{date:{on_or_after:r(v,``)},property:y},{date:{before:r(v,`day`)},property:y},{...n.slug,rich_text:{equals:d}}]}}),x=b?.object===`list`&&b.results[0];if(!x)return{content:{},images:{},info:{},items:{}};let S=a(x,`properties`);return S.properties=s(i({config:e,data:x,pageId:S.id,pathVariables:l})),{content:await o({block_id:S.id}),images:{},info:S,items:{}}},u=async({config:t,getBlocksByIdChildren:n,getDatabasesByIdQuery:r,getQuery:i,pathVariables:a,routeType:o,slug:s})=>{let{NOTION:u,ROUTE_TYPES_BY_DATA_TYPES:d}=t;return u[o?.toUpperCase()]?.hasChild?await c({config:t,getBlocksByIdChildren:n,getDatabasesByIdQuery:r,getQuery:i,pathVariables:a,routeType:o}):d[e.LISTING_BY_DATE].includes(o.toUpperCase())?await l({config:t,getBlocksByIdChildren:n,getDatabasesByIdQuery:r,pathVariables:a,routeType:o,slug:s}):{content:{},images:{},info:{},items:{}}};export{u as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"sourcesContent":["import { sortObject } from '@jeromefitz/utils'\n\nimport _omit from 'lodash-es/omit'\nimport _size from 'lodash-es/size'\n\nimport { DATA_TYPES, PROPERTIES, QUERIES } from '../../constants/index'\nimport { addTime, dataNormalized } from '../../utils/index'\n\n/**\n * @note Determine if PARENT|CHILD should be returned:\n *\n * PARENT\n * - /[parent-routeType]/[slug]\n * - /podcasts/jer-and-ky-and-guest\n *\n * CHILD\n * - /[parent-routeType]/[child-routeType]/[slug]\n * - /podcasts/jer-and-ky-and-guest/am-i-dracula-greg-gillotti\n\n *\n */\nconst getNotionSlugByRoute__getDataByParentRouteType = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getQuery,\n pathVariables,\n routeType,\n // slug,\n}) => {\n const { NOTION } = config\n const { meta } = pathVariables\n\n const ROUTE_TYPE = routeType.toUpperCase()\n\n const [parentSlug, slug] = meta\n const isChild = _size(meta) === 2\n\n const CHILD = NOTION[ROUTE_TYPE]?.hasChild?.toUpperCase()\n\n const __info: any = await getDatabasesByIdQuery({\n database_id:\n NOTION[isChild ? NOTION[CHILD].routeType.toUpperCase() : ROUTE_TYPE]\n .database_id,\n filter: {\n and: [\n {\n ...QUERIES.slug,\n rich_text: { equals: isChild ? slug : parentSlug },\n },\n ],\n },\n })\n\n const _info = __info?.object === 'list' && __info.results[0]\n // @refactor(404)\n if (!_info) {\n return { content: {}, images: {}, info: {}, items: {} }\n }\n const info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n const content = await getBlocksByIdChildren({ block_id: info.id })\n let items = {}\n\n /**\n * @note if PARENT then get CHILDREN via `items`\n */\n if (!isChild) {\n items = await getQuery({\n config,\n reqQuery: {\n databaseType: NOTION[CHILD].routeType.toUpperCase(),\n podcasts: info.id,\n },\n })\n }\n\n return { content, images: {}, info, items }\n}\n\n/**\n * @note This is unique because the following are different:\n *\n * - /events/2020/05/01/jerome-and\n * - /events/2020/05/08/jerome-and\n * - /[routeType]/[yyyy/mm/dd]/[slug]\n *\n * We actually _do_ use the date for this.\n *\n */\nconst getNotionSlugByRoute__getDataByListingDate = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n // getQuery,\n pathVariables,\n routeType,\n slug,\n}) => {\n const dateTimestamp = new Date().toISOString()\n\n const { NOTION } = config\n const { meta } = pathVariables\n\n const [year, month, day] = meta\n /**\n * @hack uh... nothing to see here, haha\n */\n const timestampQuery = new Date(\n `${year ? year : dateTimestamp.slice(0, 4)}-${month ? month : '01'}-${\n day ? day : '01'\n }`,\n )\n const property =\n NOTION[routeType.toUpperCase()]?.infoType?.notion ??\n PROPERTIES.datePublished.notion\n\n const __info: any = await getDatabasesByIdQuery({\n database_id: NOTION[routeType.toUpperCase()].database_id,\n filter: {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'day'),\n },\n property,\n },\n {\n ...QUERIES.slug,\n rich_text: { equals: slug },\n },\n ],\n },\n })\n\n const _info = __info?.object === 'list' && __info.results[0]\n // @refactor(404)\n if (!_info) {\n return { content: {}, images: {}, info: {}, items: {} }\n }\n\n const info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n const content = await getBlocksByIdChildren({ block_id: info.id })\n\n return { content, images: {}, info, items: {} }\n}\n\nconst getNotionSlugByRoute = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getQuery,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION, ROUTE_TYPES_BY_DATA_TYPES } = config\n\n /**\n * @custom (notion) DATA_TYPES.SLUG_BY_ROUTE -- but customized:\n * Determine if `routeType` is a parent|child\n *\n * // @todo(next-notion) move to `isChild`\n *\n */\n if (NOTION[routeType?.toUpperCase()]?.hasChild) {\n return await getNotionSlugByRoute__getDataByParentRouteType({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getQuery,\n pathVariables,\n routeType,\n // slug,\n })\n }\n\n /**\n * @custom (notion) DATA_TYPES.LISTING_BY_DATE\n *\n */\n if (\n ROUTE_TYPES_BY_DATA_TYPES[DATA_TYPES.LISTING_BY_DATE].includes(\n routeType.toUpperCase(),\n )\n ) {\n return await getNotionSlugByRoute__getDataByListingDate({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n // getQuery,\n pathVariables,\n routeType,\n slug,\n })\n }\n\n return { content: {}, images: {}, info: {}, items: {} }\n}\n\nexport default getNotionSlugByRoute\n"],"mappings":"6aAqBA,MAAM,EAAiD,MAAO,CAC5D,SACA,wBACA,wBACA,WACA,gBACA,eAEI,CACJ,GAAM,CAAE,UAAW,EACb,CAAE,QAAS,EAEX,EAAa,EAAU,aAAa,CAEpC,CAAC,EAAY,GAAQ,EACrB,EAAUA,EAAM,EAAK,GAAK,EAE1B,EAAQ,EAAO,IAAa,UAAU,aAAa,CAEnD,EAAc,MAAM,EAAsB,CAC9C,YACE,EAAO,EAAU,EAAO,GAAO,UAAU,aAAa,CAAG,GACtD,YACL,OAAQ,CACN,IAAK,CACH,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,EAAU,EAAO,EAAY,CACnD,CACF,CACF,CACF,CAAC,CAEI,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,CAAE,QA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E,CAAE,CAGzD,IAAM,EAAOA,EAAM,EAAO,aAAa,CAMvC,MALA,GAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACxE,CAGM,CAAE,QAFO,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,CAEhD,OAAQ,EAAE,CAAE,OAAM,MAAO,EAAE,CAAE,EAG3C,EAAuB,MAAO,CAClC,SACA,wBACA,wBACA,WACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,SAAQ,6BAA8B,EAyC9C,OAhCI,EAAO,GAAW,aAAa,GAAG,SAC7B,MAAM,EAA+C,CAC1D,SACA,wBACA,wBACA,WACA,gBACA,YAED,CAAC,CAQF,EAA0B,EAAW,iBAAiB,SACpD,EAAU,aAAa,CACxB,CAEM,MAAM,EAA2C,CACtD,SACA,wBACA,wBAEA,gBACA,YACA,OACD,CAAC,CAGG,CAAE,QAAS,EAAE,CAAE,OAAQ,EAAE,CAAE,KAAM,EAAE,CAAE,MAAO,EAAE,CAAE"}
1
+ {"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"sourcesContent":["import { sortObject } from '@jeromefitz/utils'\n\nimport { omit as _omit, size as _size } from 'lodash-es'\n\nimport { DATA_TYPES, PROPERTIES, QUERIES } from '../../constants/index'\nimport { addTime, dataNormalized } from '../../utils/index'\n\n/**\n * @note Determine if PARENT|CHILD should be returned:\n *\n * PARENT\n * - /[parent-routeType]/[slug]\n * - /podcasts/jer-and-ky-and-guest\n *\n * CHILD\n * - /[parent-routeType]/[child-routeType]/[slug]\n * - /podcasts/jer-and-ky-and-guest/am-i-dracula-greg-gillotti\n\n *\n */\nconst getNotionSlugByRoute__getDataByParentRouteType = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getQuery,\n pathVariables,\n routeType,\n // slug,\n}) => {\n const { NOTION } = config\n const { meta } = pathVariables\n\n const ROUTE_TYPE = routeType.toUpperCase()\n\n const [parentSlug, slug] = meta\n const isChild = _size(meta) === 2\n\n const CHILD = NOTION[ROUTE_TYPE]?.hasChild?.toUpperCase()\n\n const __info: any = await getDatabasesByIdQuery({\n database_id:\n NOTION[isChild ? NOTION[CHILD].routeType.toUpperCase() : ROUTE_TYPE]\n .database_id,\n filter: {\n and: [\n {\n ...QUERIES.slug,\n rich_text: { equals: isChild ? slug : parentSlug },\n },\n ],\n },\n })\n\n const _info = __info?.object === 'list' && __info.results[0]\n // @refactor(404)\n if (!_info) {\n return { content: {}, images: {}, info: {}, items: {} }\n }\n const info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n const content = await getBlocksByIdChildren({ block_id: info.id })\n let items = {}\n\n /**\n * @note if PARENT then get CHILDREN via `items`\n */\n if (!isChild) {\n items = await getQuery({\n config,\n reqQuery: {\n databaseType: NOTION[CHILD].routeType.toUpperCase(),\n podcasts: info.id,\n },\n })\n }\n\n return { content, images: {}, info, items }\n}\n\n/**\n * @note This is unique because the following are different:\n *\n * - /events/2020/05/01/jerome-and\n * - /events/2020/05/08/jerome-and\n * - /[routeType]/[yyyy/mm/dd]/[slug]\n *\n * We actually _do_ use the date for this.\n *\n */\nconst getNotionSlugByRoute__getDataByListingDate = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n // getQuery,\n pathVariables,\n routeType,\n slug,\n}) => {\n const dateTimestamp = new Date().toISOString()\n\n const { NOTION } = config\n const { meta } = pathVariables\n\n const [year, month, day] = meta\n /**\n * @hack uh... nothing to see here, haha\n */\n const timestampQuery = new Date(\n `${year ? year : dateTimestamp.slice(0, 4)}-${month ? month : '01'}-${\n day ? day : '01'\n }`,\n )\n const property =\n NOTION[routeType.toUpperCase()]?.infoType?.notion ??\n PROPERTIES.datePublished.notion\n\n const __info: any = await getDatabasesByIdQuery({\n database_id: NOTION[routeType.toUpperCase()].database_id,\n filter: {\n and: [\n {\n date: {\n on_or_after: addTime(timestampQuery, ''),\n },\n property,\n },\n {\n date: {\n before: addTime(timestampQuery, 'day'),\n },\n property,\n },\n {\n ...QUERIES.slug,\n rich_text: { equals: slug },\n },\n ],\n },\n })\n\n const _info = __info?.object === 'list' && __info.results[0]\n // @refactor(404)\n if (!_info) {\n return { content: {}, images: {}, info: {}, items: {} }\n }\n\n const info = _omit(_info, 'properties')\n info.properties = sortObject(\n dataNormalized({ config, data: _info, pageId: info.id, pathVariables }),\n )\n const content = await getBlocksByIdChildren({ block_id: info.id })\n\n return { content, images: {}, info, items: {} }\n}\n\nconst getNotionSlugByRoute = async ({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getQuery,\n pathVariables,\n routeType,\n slug,\n}) => {\n const { NOTION, ROUTE_TYPES_BY_DATA_TYPES } = config\n\n /**\n * @custom (notion) DATA_TYPES.SLUG_BY_ROUTE -- but customized:\n * Determine if `routeType` is a parent|child\n *\n * // @todo(next-notion) move to `isChild`\n *\n */\n if (NOTION[routeType?.toUpperCase()]?.hasChild) {\n return await getNotionSlugByRoute__getDataByParentRouteType({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n getQuery,\n pathVariables,\n routeType,\n // slug,\n })\n }\n\n /**\n * @custom (notion) DATA_TYPES.LISTING_BY_DATE\n *\n */\n if (\n ROUTE_TYPES_BY_DATA_TYPES[DATA_TYPES.LISTING_BY_DATE].includes(\n routeType.toUpperCase(),\n )\n ) {\n return await getNotionSlugByRoute__getDataByListingDate({\n config,\n getBlocksByIdChildren,\n getDatabasesByIdQuery,\n // getQuery,\n pathVariables,\n routeType,\n slug,\n })\n }\n\n return { content: {}, images: {}, info: {}, items: {} }\n}\n\nexport default getNotionSlugByRoute\n"],"mappings":"6UAoBA,MAAM,EAAiD,MAAO,CAC5D,SACA,wBACA,wBACA,WACA,gBACA,eAEI,CACJ,GAAM,CAAE,UAAW,EACb,CAAE,QAAS,EAEX,EAAa,EAAU,aAAa,CAE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7C,OAAQ,CACN,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,GAAG,CACzC,CACD,WACD,CACD,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,MAAM,CACvC,CACD,WACD,CACD,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,EAAM,CAC5B,CACF,CACF,CACF,CAAC,CAEI,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,CAAE,QAAS,EAAE,CAAE,OAAQ,EAAE,CAAE,KAAM,EAAE,CAAE,MAAO,EAAE,CAAE,CAGzD,IAAM,EAAOA,EAAM,EAAO,aAAa,CAMvC,MALA,GAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACxE,CAGM,CAAE,QAFO,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,CAEhD,OAAQ,EAAE,CAAE,OAAM,MAAO,EAAE,CAAE,EAG3C,EAAuB,MAAO,CAClC,SACA,wBACA,wBACA,WACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,SAAQ,6BAA8B,EAyC9C,OAhCI,EAAO,GAAW,aAAa,GAAG,SAC7B,MAAM,EAA+C,CAC1D,SACA,wBACA,wBACA,WACA,gBACA,YAED,CAAC,CAQF,EAA0B,EAAW,iBAAiB,SACpD,EAAU,aAAa,CACxB,CAEM,MAAM,EAA2C,CACtD,SACA,wBACA,wBAEA,gBACA,YACA,OACD,CAAC,CAGG,CAAE,QAAS,EAAE,CAAE,OAAQ,EAAE,CAAE,KAAM,EAAE,CAAE,MAAO,EAAE,CAAE"}
@@ -1,4 +1,4 @@
1
- import { r as DataTypes } from "../../index-BnQkUs70.mjs";
1
+ import { r as DataTypes } from "../../index-CvmUSReI.mjs";
2
2
 
3
3
  //#region src/queries/getPathVariables/index.d.ts
4
4
  declare const getPathVariables: ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getPathVariables/index.ts"],"mappings":";;;cAeM,gBAAA;EAAoB,QAAA;EAAA;AAAA;;;;YAAA,SAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getPathVariables/index.ts"],"mappings":";;;cAiBM,gBAAA;EAAoB,QAAA;EAAA;AAAA;;;;YAAA,SAAA"}
@@ -1 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import"../../constants-C5KahlYP.mjs";import"../../utils-DGZbVKmT.mjs";import"../../getTypes-B309tjVR.mjs";import"../../getTitle-PyFbOk6t.mjs";import"../../files-CS-BvFuw.mjs";import{t as e}from"../../getPathVariables-ffMiRvxv.mjs";export{e as default};
1
+ import"../../chunk-pm2C21R4.mjs";import"../../utils-bTlwvfkE.mjs";import e from"../../utils/getDataType/index.mjs";import"../../getTypes-Df5GL8wS.mjs";import{drop as t,dropRight as n,first as r,includes as i,isInteger as a,join as o,last as s,size as c}from"lodash-es";const l=({catchAll:l,config:u})=>{let{NOTION:d,PAGES__HOMEPAGE:f,ROUTE_META:p,ROUTE_TYPES:m}=u,h=c(l),g=r(l),_=g.toUpperCase(),v=s(l),y=h>1&&i(p,_)?t(l):t(n(l)),b=g===v&&!i(m,_)?d.PAGES.routeType:g,x=g!==v&&!a(parseInt(v))?v:g,S=b===d.PAGES.routeType.toLowerCase(),C=x===g,w={hasMeta:!!y&&c(y)!==0,isIndex:C,isPage:S,meta:y,routeType:b,slug:x,url:S&&g===f?``:o(l,`/`)},T=e(w);return{...w,dataType:T}};export{l as default};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["size","_size","first","_first","last","_last","_includes","_drop","_dropRight","_isInteger","_join"],"sources":["../../../src/queries/getPathVariables/index.ts"],"sourcesContent":["/**\n * @refactor(lodash)\n */\nimport {\n drop as _drop,\n dropRight as _dropRight,\n first as _first,\n includes as _includes,\n isInteger as _isInteger,\n join as _join,\n last as _last,\n size as _size,\n} from 'lodash-es'\n\n// import { DATA_TYPES } from '../../constants/index'\nimport { getDataType } from '../../utils/index'\n\nconst getPathVariables = ({ catchAll, config }) => {\n const { NOTION, PAGES__HOMEPAGE, ROUTE_META, ROUTE_TYPES } = config\n const size: number = _size(catchAll)\n const first: any = _first(catchAll)\n const FIRST = first.toUpperCase()\n const last: any = _last(catchAll)\n // const LAST = last.toUpperCase()\n\n const meta =\n size > 1 && _includes(ROUTE_META, FIRST)\n ? _drop(catchAll)\n : _drop(_dropRight(catchAll))\n\n const routeType =\n first === last && !_includes(ROUTE_TYPES, FIRST) ? NOTION.PAGES.routeType : first\n // biome-ignore lint/correctness/useParseIntRadix: migrate\n const slug = first !== last && !_isInteger(parseInt(last)) ? last : first\n\n const isPage = routeType === NOTION.PAGES.routeType.toLowerCase()\n const isIndex = slug === first\n const hasMeta = !!meta && _size(meta) !== 0\n\n const url = isPage && first === PAGES__HOMEPAGE ? '' : _join(catchAll, '/')\n\n const pathVariables = {\n hasMeta,\n isIndex,\n isPage,\n meta,\n routeType,\n slug,\n url,\n }\n\n // console.dir(`> pathVariables`)\n // console.dir(pathVariables)\n\n const dataType = getDataType(pathVariables)\n\n return {\n ...pathVariables,\n dataType,\n }\n}\n\nexport default getPathVariables\n"],"mappings":"6QAiBA,MAAM,GAAoB,CAAE,WAAU,YAAa,CACjD,GAAM,CAAE,SAAQ,kBAAiB,aAAY,eAAgB,EACvDA,EAAeC,EAAM,EAAS,CAC9BC,EAAaC,EAAO,EAAS,CAC7B,EAAQD,EAAM,aAAa,CAC3BE,EAAYC,EAAM,EAAS,CAG3B,EACJL,EAAO,GAAKM,EAAU,EAAY,EAAM,CACpCC,EAAM,EAAS,CACfA,EAAMC,EAAW,EAAS,CAAC,CAE3B,EACJN,IAAUE,GAAQ,CAACE,EAAU,EAAa,EAAM,CAAG,EAAO,MAAM,UAAYJ,EAExE,EAAOA,IAAUE,GAAQ,CAACK,EAAW,SAASL,EAAK,CAAC,CAAGA,EAAOF,EAE9D,EAAS,IAAc,EAAO,MAAM,UAAU,aAAa,CAC3D,EAAU,IAASA,EAKnB,EAAgB,CACpB,QALc,CAAC,CAAC,GAAQD,EAAM,EAAK,GAAK,EAMxC,UACA,SACA,OACA,YACA,OACA,IATU,GAAUC,IAAU,EAAkB,GAAKQ,EAAM,EAAU,IAAI,CAU1E,CAKK,EAAW,EAAY,EAAc,CAE3C,MAAO,CACL,GAAG,EACH,WACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getQuery/index.ts"],"mappings":";cAuBM,QAAA;EAAkB,MAAA;EAAA,oBAAA;EAAA;AAAA;;;;MAA0C,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getQuery/index.ts"],"mappings":";cAqBM,QAAA;EAAkB,MAAA;EAAA,oBAAA;EAAA;AAAA;;;;MAA0C,OAAA"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../map-C4ZbQ-N0.mjs";import"../../_baseProperty-D8FHbIgx.mjs";import{i as t}from"../../constants-C5KahlYP.mjs";import{r as n,t as r}from"../../utils-DGZbVKmT.mjs";import"../../getTypes-B309tjVR.mjs";import"../../getTitle-PyFbOk6t.mjs";import{n as i}from"../../files-CS-BvFuw.mjs";import{avoidRateLimit as a,isObjectEmpty as o}from"@jeromefitz/utils";const s=[{direction:`ascending`,property:t.slug.notion}],c=async({config:c,notionDatabasesQuery:l,reqQuery:u})=>{let{NOTION:d}=c,{databaseType:f}=u,p=f,m=!1,h=d[f.toUpperCase()].database_id;if(!h)return[];let g={},_={},v,y;if(f===`EPISODES`){y=s;let{podcasts:n}=u,r=[],a=[];n&&a.push(...n?.split(`,`)),i(a)>0&&e(a,e=>r.push({property:t.relationEpisodes__Podcasts.notion,relation:{contains:e}})),v={or:[...r]}}else m=!0;if(!m&&(!g||o(g))){await a(0);let e;v?(v?.or.length===0&&(v={and:[{property:t.slug.notion,rich_text:{equals:`@hack(notion)-do-not-return`}}]}),e=await l({database_id:h,filter:v,sorts:y}),g=e,_=r({config:c,results:e.results,routeType:p}),g=n(g,`results`),g.results=_):m=!0}return g};export{c as default};
1
+ import"../../chunk-pm2C21R4.mjs";import{PROPERTIES as e}from"../../constants/index.mjs";import{t}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";import{map as n,omit as r,size as i}from"lodash-es";import{avoidRateLimit as a,isObjectEmpty as o}from"@jeromefitz/utils";const s=[{direction:`ascending`,property:e.slug.notion}],c=async({config:c,notionDatabasesQuery:l,reqQuery:u})=>{let{NOTION:d}=c,{databaseType:f}=u,p=f,m=!1,h=d[f.toUpperCase()].database_id;if(!h)return[];let g={},_={},v,y;if(f===`EPISODES`){y=s;let{podcasts:t}=u,r=[],a=[];t&&a.push(...t?.split(`,`)),i(a)>0&&n(a,t=>r.push({property:e.relationEpisodes__Podcasts.notion,relation:{contains:t}})),v={or:[...r]}}else m=!0;if(!m&&(!g||o(g))){await a(0);let n;v?(v?.or.length===0&&(v={and:[{property:e.slug.notion,rich_text:{equals:`@hack(notion)-do-not-return`}}]}),n=await l({database_id:h,filter:v,sorts:y}),g=n,_=t({config:c,results:n.results,routeType:p}),g=r(g,`results`),g.results=_):m=!0}return g};export{c as default};
2
2
  //# sourceMappingURL=index.mjs.map