@jeromefitz/notion 6.2.0-canary.1 → 7.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 (315) hide show
  1. package/{dist/utils/get-types/_unsupported.mjs → _unsupported-BUIwc9lr.mjs} +2 -2
  2. package/_unsupported-BUIwc9lr.mjs.map +1 -0
  3. package/{dist/utils/add-time/index.mjs → add-time-B_LfV4Ex.mjs} +2 -2
  4. package/add-time-B_LfV4Ex.mjs.map +1 -0
  5. package/checkbox-Cil1erOZ.mjs +2 -0
  6. package/checkbox-Cil1erOZ.mjs.map +1 -0
  7. package/constants/index.d.mts +2 -0
  8. package/constants/index.mjs +1 -0
  9. package/{dist/constants/index.mjs → constants-C2jPji6h.mjs} +2 -2
  10. package/constants-C2jPji6h.mjs.map +1 -0
  11. package/date-IJAT1r3Y.mjs +2 -0
  12. package/date-IJAT1r3Y.mjs.map +1 -0
  13. package/dist-BQciLh9t.mjs +2 -0
  14. package/dist-BQciLh9t.mjs.map +1 -0
  15. package/email-DygPLxSo.mjs +2 -0
  16. package/email-DygPLxSo.mjs.map +1 -0
  17. package/{dist/utils/get-types/files.mjs → files-Dx1jw5iY.mjs} +2 -2
  18. package/files-Dx1jw5iY.mjs.map +1 -0
  19. package/{dist/queries/get-blocks-by-id-children/index.mjs → get-blocks-by-id-children-BRe4p0pZ.mjs} +2 -2
  20. package/get-blocks-by-id-children-BRe4p0pZ.mjs.map +1 -0
  21. package/get-data-type-B5X5VOmp.mjs +2 -0
  22. package/get-data-type-B5X5VOmp.mjs.map +1 -0
  23. package/get-databases-by-id-query-CI9TMkPN.mjs +2 -0
  24. package/get-databases-by-id-query-CI9TMkPN.mjs.map +1 -0
  25. package/{dist/queries/get-deep-fetch-all-children/index.mjs → get-deep-fetch-all-children-DVZ-HFbN.mjs} +2 -2
  26. package/get-deep-fetch-all-children-DVZ-HFbN.mjs.map +1 -0
  27. package/{dist/queries/get-info-type/index.mjs → get-info-type-CUsHqtfs.mjs} +2 -2
  28. package/get-info-type-CUsHqtfs.mjs.map +1 -0
  29. package/get-notion-listing-JJxOipMx.mjs +2 -0
  30. package/get-notion-listing-JJxOipMx.mjs.map +1 -0
  31. package/get-notion-listing-by-date-CSKBdFDQ.mjs +2 -0
  32. package/get-notion-listing-by-date-CSKBdFDQ.mjs.map +1 -0
  33. package/get-notion-slug-BecwpT0b.mjs +2 -0
  34. package/get-notion-slug-BecwpT0b.mjs.map +1 -0
  35. package/get-notion-slug-by-route-Dh428D_m.mjs +2 -0
  36. package/get-notion-slug-by-route-Dh428D_m.mjs.map +1 -0
  37. package/{dist/queries/get-pages-by-id/index.mjs → get-pages-by-id-D_3I7OED.mjs} +2 -2
  38. package/get-pages-by-id-D_3I7OED.mjs.map +1 -0
  39. package/get-path-variables-CnBrxTgg.mjs +2 -0
  40. package/get-path-variables-CnBrxTgg.mjs.map +1 -0
  41. package/get-query-ljtSpKL5.mjs +2 -0
  42. package/get-query-ljtSpKL5.mjs.map +1 -0
  43. package/{dist/utils/get-title/index.mjs → get-title-BWc2Ckhi.mjs} +2 -2
  44. package/get-title-BWc2Ckhi.mjs.map +1 -0
  45. package/get-types-Clb6OmBv.mjs +2 -0
  46. package/{dist/get-types-7QEbhRzY.mjs.map → get-types-Clb6OmBv.mjs.map} +1 -1
  47. package/{dist/constants/index.d.mts → index-BD5kzRhY.d.mts} +3 -3
  48. package/index-BD5kzRhY.d.mts.map +1 -0
  49. package/{dist/utils/get-data-type/index.d.mts → index-BGofpiiB.d.mts} +3 -3
  50. package/index-BGofpiiB.d.mts.map +1 -0
  51. package/{dist/queries/get-notion-listing-by-date/index.d.mts → index-BIttGCzA.d.mts} +2 -2
  52. package/index-BIttGCzA.d.mts.map +1 -0
  53. package/{dist/queries/get-pages-by-id/index.d.mts → index-C-J3ICp0.d.mts} +2 -2
  54. package/index-C-J3ICp0.d.mts.map +1 -0
  55. package/{dist/queries/get-notion-slug-by-route/index.d.mts → index-CLQVoKDp.d.mts} +2 -2
  56. package/index-CLQVoKDp.d.mts.map +1 -0
  57. package/{dist/queries/get-databases-by-id-query/index.d.mts → index-CucnheQT.d.mts} +3 -3
  58. package/index-CucnheQT.d.mts.map +1 -0
  59. package/{dist/queries/get-path-variables/index.d.mts → index-D16uYjWr.d.mts} +3 -3
  60. package/index-D16uYjWr.d.mts.map +1 -0
  61. package/{dist/queries/get-notion-listing/index.d.mts → index-D4Gn1cYC.d.mts} +2 -2
  62. package/index-D4Gn1cYC.d.mts.map +1 -0
  63. package/{dist/utils/data-normalized-results/index.d.mts → index-DMqCumJi.d.mts} +2 -2
  64. package/index-DMqCumJi.d.mts.map +1 -0
  65. package/{dist/utils/get-types/index.d.mts → index-DZSqTeBx.d.mts} +2 -2
  66. package/index-DZSqTeBx.d.mts.map +1 -0
  67. package/{dist/utils/data-normalized/index.d.mts → index-DZjFlXjH.d.mts} +2 -2
  68. package/index-DZjFlXjH.d.mts.map +1 -0
  69. package/{dist/queries/get-deep-fetch-all-children/index.d.mts → index-D_fBH_D4.d.mts} +2 -2
  70. package/index-D_fBH_D4.d.mts.map +1 -0
  71. package/{dist/queries/get-notion-slug/index.d.mts → index-Dx2yW5u0.d.mts} +2 -2
  72. package/index-Dx2yW5u0.d.mts.map +1 -0
  73. package/{dist/utils/add-time/index.d.mts → index-DxiWPo1l.d.mts} +2 -2
  74. package/index-DxiWPo1l.d.mts.map +1 -0
  75. package/{dist/queries/get-info-type/index.d.mts → index-H5Qko6iL.d.mts} +2 -2
  76. package/index-H5Qko6iL.d.mts.map +1 -0
  77. package/{dist/utils/get-title/index.d.mts → index-iru-ct3u.d.mts} +2 -2
  78. package/index-iru-ct3u.d.mts.map +1 -0
  79. package/{dist/queries/get-blocks-by-id-children/index.d.mts → index-oAghjuN5.d.mts} +2 -2
  80. package/index-oAghjuN5.d.mts.map +1 -0
  81. package/{dist/queries/get-query/index.d.mts → index-wMZIVRBv.d.mts} +2 -2
  82. package/index-wMZIVRBv.d.mts.map +1 -0
  83. package/{dist/index.d.mts → index.d.mts} +1 -1
  84. package/index.d.mts.map +1 -0
  85. package/index.mjs +2 -0
  86. package/index.mjs.map +1 -0
  87. package/index.test.d.mts +1 -0
  88. package/index.test.mjs +129 -0
  89. package/index.test.mjs.map +1 -0
  90. package/magic-string.es-D6kIB8Km.mjs +18 -0
  91. package/magic-string.es-D6kIB8Km.mjs.map +1 -0
  92. package/{dist/utils/get-types/multi-select.mjs → multi-select-BTDQCZWJ.mjs} +2 -2
  93. package/multi-select-BTDQCZWJ.mjs.map +1 -0
  94. package/number-DXsVfS7U.mjs +2 -0
  95. package/number-DXsVfS7U.mjs.map +1 -0
  96. package/package.json +57 -208
  97. package/{dist/utils/get-types/people.mjs → people-Ognwaka4.mjs} +2 -2
  98. package/people-Ognwaka4.mjs.map +1 -0
  99. package/phone-number-D-jSJ6fm.mjs +2 -0
  100. package/phone-number-D-jSJ6fm.mjs.map +1 -0
  101. package/queries/get-blocks-by-id-children/index.d.mts +2 -0
  102. package/queries/get-blocks-by-id-children/index.mjs +1 -0
  103. package/queries/get-databases-by-id-query/index.d.mts +2 -0
  104. package/queries/get-databases-by-id-query/index.mjs +1 -0
  105. package/queries/get-deep-fetch-all-children/index.d.mts +2 -0
  106. package/queries/get-deep-fetch-all-children/index.mjs +1 -0
  107. package/queries/get-info-type/index.d.mts +2 -0
  108. package/queries/get-info-type/index.mjs +1 -0
  109. package/queries/get-notion-listing/index.d.mts +2 -0
  110. package/queries/get-notion-listing/index.mjs +1 -0
  111. package/queries/get-notion-listing-by-date/index.d.mts +2 -0
  112. package/queries/get-notion-listing-by-date/index.mjs +1 -0
  113. package/queries/get-notion-slug/index.d.mts +2 -0
  114. package/queries/get-notion-slug/index.mjs +1 -0
  115. package/queries/get-notion-slug-by-route/index.d.mts +2 -0
  116. package/queries/get-notion-slug-by-route/index.mjs +1 -0
  117. package/queries/get-pages-by-id/index.d.mts +2 -0
  118. package/queries/get-pages-by-id/index.mjs +1 -0
  119. package/queries/get-path-variables/index.d.mts +2 -0
  120. package/queries/get-path-variables/index.mjs +1 -0
  121. package/queries/get-query/index.d.mts +2 -0
  122. package/queries/get-query/index.mjs +1 -0
  123. package/queries/index.d.mts +12 -0
  124. package/queries/index.mjs +1 -0
  125. package/queries-CCGQpuUT.mjs +1 -0
  126. package/{dist/utils/get-types/rich-text.mjs → rich-text-pNpMuY2o.mjs} +2 -2
  127. package/rich-text-pNpMuY2o.mjs.map +1 -0
  128. package/{dist/utils/get-types/select.mjs → select-i6mHDBMN.mjs} +2 -2
  129. package/select-i6mHDBMN.mjs.map +1 -0
  130. package/title-vmIyt8-r.mjs +2 -0
  131. package/title-vmIyt8-r.mjs.map +1 -0
  132. package/url-D7qu9nU2.mjs +2 -0
  133. package/url-D7qu9nU2.mjs.map +1 -0
  134. package/utils/add-time/index.d.mts +2 -0
  135. package/utils/add-time/index.mjs +1 -0
  136. package/utils/data-normalized/index.d.mts +2 -0
  137. package/utils/data-normalized/index.mjs +1 -0
  138. package/utils/data-normalized-results/index.d.mts +2 -0
  139. package/utils/data-normalized-results/index.mjs +1 -0
  140. package/utils/get-data-type/index.d.mts +2 -0
  141. package/utils/get-data-type/index.mjs +1 -0
  142. package/utils/get-title/index.d.mts +2 -0
  143. package/utils/get-title/index.mjs +1 -0
  144. package/utils/get-types/_unsupported.mjs +1 -0
  145. package/utils/get-types/checkbox.mjs +1 -0
  146. package/utils/get-types/date.mjs +1 -0
  147. package/utils/get-types/email.mjs +1 -0
  148. package/utils/get-types/files.mjs +1 -0
  149. package/utils/get-types/index.d.mts +2 -0
  150. package/utils/get-types/index.mjs +1 -0
  151. package/utils/get-types/multi-select.mjs +1 -0
  152. package/utils/get-types/number.mjs +1 -0
  153. package/utils/get-types/people.mjs +1 -0
  154. package/utils/get-types/phone-number.mjs +1 -0
  155. package/utils/get-types/relation.mjs +1 -0
  156. package/utils/get-types/rich-text.mjs +1 -0
  157. package/utils/get-types/rollup.mjs +1 -0
  158. package/utils/get-types/select.mjs +1 -0
  159. package/utils/get-types/title.mjs +1 -0
  160. package/utils/get-types/url.mjs +1 -0
  161. package/utils/index.d.mts +7 -0
  162. package/utils/index.mjs +1 -0
  163. package/utils-B1QU_ezs.mjs +2 -0
  164. package/{dist/utils-SxsCJsDP.mjs.map → utils-B1QU_ezs.mjs.map} +1 -1
  165. package/.turbo/turbo-build.log +0 -4
  166. package/.turbo/turbo-lint$colon$ts.log +0 -1
  167. package/dist/constants/index.d.mts.map +0 -1
  168. package/dist/constants/index.mjs.map +0 -1
  169. package/dist/get-types-7QEbhRzY.mjs +0 -2
  170. package/dist/index.d.mts.map +0 -1
  171. package/dist/index.mjs +0 -2
  172. package/dist/index.mjs.map +0 -1
  173. package/dist/queries/get-blocks-by-id-children/index.d.mts.map +0 -1
  174. package/dist/queries/get-blocks-by-id-children/index.mjs.map +0 -1
  175. package/dist/queries/get-databases-by-id-query/index.d.mts.map +0 -1
  176. package/dist/queries/get-databases-by-id-query/index.mjs +0 -2
  177. package/dist/queries/get-databases-by-id-query/index.mjs.map +0 -1
  178. package/dist/queries/get-deep-fetch-all-children/index.d.mts.map +0 -1
  179. package/dist/queries/get-deep-fetch-all-children/index.mjs.map +0 -1
  180. package/dist/queries/get-info-type/index.d.mts.map +0 -1
  181. package/dist/queries/get-info-type/index.mjs.map +0 -1
  182. package/dist/queries/get-notion-listing/index.d.mts.map +0 -1
  183. package/dist/queries/get-notion-listing/index.mjs +0 -2
  184. package/dist/queries/get-notion-listing/index.mjs.map +0 -1
  185. package/dist/queries/get-notion-listing-by-date/index.d.mts.map +0 -1
  186. package/dist/queries/get-notion-listing-by-date/index.mjs +0 -2
  187. package/dist/queries/get-notion-listing-by-date/index.mjs.map +0 -1
  188. package/dist/queries/get-notion-slug/index.d.mts.map +0 -1
  189. package/dist/queries/get-notion-slug/index.mjs +0 -2
  190. package/dist/queries/get-notion-slug/index.mjs.map +0 -1
  191. package/dist/queries/get-notion-slug-by-route/index.d.mts.map +0 -1
  192. package/dist/queries/get-notion-slug-by-route/index.mjs +0 -2
  193. package/dist/queries/get-notion-slug-by-route/index.mjs.map +0 -1
  194. package/dist/queries/get-pages-by-id/index.d.mts.map +0 -1
  195. package/dist/queries/get-pages-by-id/index.mjs.map +0 -1
  196. package/dist/queries/get-path-variables/index.d.mts.map +0 -1
  197. package/dist/queries/get-path-variables/index.mjs +0 -2
  198. package/dist/queries/get-path-variables/index.mjs.map +0 -1
  199. package/dist/queries/get-query/index.d.mts.map +0 -1
  200. package/dist/queries/get-query/index.mjs +0 -2
  201. package/dist/queries/get-query/index.mjs.map +0 -1
  202. package/dist/queries/index.d.mts +0 -12
  203. package/dist/queries/index.mjs +0 -1
  204. package/dist/utils/add-time/index.d.mts.map +0 -1
  205. package/dist/utils/add-time/index.mjs.map +0 -1
  206. package/dist/utils/data-normalized/index.d.mts.map +0 -1
  207. package/dist/utils/data-normalized/index.mjs +0 -1
  208. package/dist/utils/data-normalized-results/index.d.mts.map +0 -1
  209. package/dist/utils/data-normalized-results/index.mjs +0 -1
  210. package/dist/utils/get-data-type/index.d.mts.map +0 -1
  211. package/dist/utils/get-data-type/index.mjs +0 -2
  212. package/dist/utils/get-data-type/index.mjs.map +0 -1
  213. package/dist/utils/get-title/index.d.mts.map +0 -1
  214. package/dist/utils/get-title/index.mjs.map +0 -1
  215. package/dist/utils/get-types/_unsupported.mjs.map +0 -1
  216. package/dist/utils/get-types/checkbox.mjs +0 -2
  217. package/dist/utils/get-types/checkbox.mjs.map +0 -1
  218. package/dist/utils/get-types/date.mjs +0 -2
  219. package/dist/utils/get-types/date.mjs.map +0 -1
  220. package/dist/utils/get-types/email.mjs +0 -2
  221. package/dist/utils/get-types/email.mjs.map +0 -1
  222. package/dist/utils/get-types/files.mjs.map +0 -1
  223. package/dist/utils/get-types/index.d.mts.map +0 -1
  224. package/dist/utils/get-types/index.mjs +0 -1
  225. package/dist/utils/get-types/multi-select.mjs.map +0 -1
  226. package/dist/utils/get-types/number.mjs +0 -2
  227. package/dist/utils/get-types/number.mjs.map +0 -1
  228. package/dist/utils/get-types/people.mjs.map +0 -1
  229. package/dist/utils/get-types/phone-number.mjs +0 -2
  230. package/dist/utils/get-types/phone-number.mjs.map +0 -1
  231. package/dist/utils/get-types/relation.mjs +0 -1
  232. package/dist/utils/get-types/rich-text.mjs.map +0 -1
  233. package/dist/utils/get-types/rollup.mjs +0 -1
  234. package/dist/utils/get-types/select.mjs.map +0 -1
  235. package/dist/utils/get-types/title.mjs +0 -2
  236. package/dist/utils/get-types/title.mjs.map +0 -1
  237. package/dist/utils/get-types/url.mjs +0 -2
  238. package/dist/utils/get-types/url.mjs.map +0 -1
  239. package/dist/utils/index.d.mts +0 -7
  240. package/dist/utils/index.mjs +0 -1
  241. package/dist/utils-SxsCJsDP.mjs +0 -2
  242. package/release.config.js +0 -25
  243. package/src/constants/index.ts +0 -1326
  244. package/src/index.ts +0 -151
  245. package/src/queries/get-blocks-by-id-children/index.ts +0 -12
  246. package/src/queries/get-databases-by-id-query/index.ts +0 -28
  247. package/src/queries/get-deep-fetch-all-children/index.ts +0 -35
  248. package/src/queries/get-info-type/index.ts +0 -40
  249. package/src/queries/get-notion-listing/index.ts +0 -91
  250. package/src/queries/get-notion-listing-by-date/index.ts +0 -190
  251. package/src/queries/get-notion-slug/index.ts +0 -64
  252. package/src/queries/get-notion-slug-by-route/index.ts +0 -201
  253. package/src/queries/get-pages-by-id/index.ts +0 -12
  254. package/src/queries/get-path-variables/index.ts +0 -60
  255. package/src/queries/get-query/index.ts +0 -140
  256. package/src/queries/index.ts +0 -25
  257. package/src/schema/index.ts +0 -386
  258. package/src/utils/add-time/index.ts +0 -16
  259. package/src/utils/data-normalized/index.ts +0 -49
  260. package/src/utils/data-normalized-results/index.ts +0 -29
  261. package/src/utils/get-data-type/index.ts +0 -62
  262. package/src/utils/get-title/index.ts +0 -21
  263. package/src/utils/get-types/_unsupported.ts +0 -7
  264. package/src/utils/get-types/checkbox.ts +0 -3
  265. package/src/utils/get-types/date.ts +0 -6
  266. package/src/utils/get-types/email.ts +0 -3
  267. package/src/utils/get-types/files.ts +0 -67
  268. package/src/utils/get-types/index.ts +0 -41
  269. package/src/utils/get-types/multi-select.ts +0 -16
  270. package/src/utils/get-types/number.ts +0 -6
  271. package/src/utils/get-types/people.ts +0 -22
  272. package/src/utils/get-types/phone-number.ts +0 -3
  273. package/src/utils/get-types/relation.ts +0 -18
  274. package/src/utils/get-types/rich-text.ts +0 -5
  275. package/src/utils/get-types/rollup.ts +0 -30
  276. package/src/utils/get-types/select.ts +0 -21
  277. package/src/utils/get-types/title.ts +0 -4
  278. package/src/utils/get-types/url.ts +0 -3
  279. package/src/utils/index.ts +0 -16
  280. package/tsconfig.json +0 -15
  281. package/tsdown.config.ts +0 -14
  282. /package/{dist/index-BAoq6yHe.d.mts → index-BAoq6yHe.d.mts} +0 -0
  283. /package/{dist/index-BAoq6yHe.d.mts.map → index-BAoq6yHe.d.mts.map} +0 -0
  284. /package/{dist/schema → schema}/index.d.mts +0 -0
  285. /package/{dist/schema → schema}/index.mjs +0 -0
  286. /package/{dist/utils → utils}/get-types/_unsupported.d.mts +0 -0
  287. /package/{dist/utils → utils}/get-types/_unsupported.d.mts.map +0 -0
  288. /package/{dist/utils → utils}/get-types/checkbox.d.mts +0 -0
  289. /package/{dist/utils → utils}/get-types/checkbox.d.mts.map +0 -0
  290. /package/{dist/utils → utils}/get-types/date.d.mts +0 -0
  291. /package/{dist/utils → utils}/get-types/date.d.mts.map +0 -0
  292. /package/{dist/utils → utils}/get-types/email.d.mts +0 -0
  293. /package/{dist/utils → utils}/get-types/email.d.mts.map +0 -0
  294. /package/{dist/utils → utils}/get-types/files.d.mts +0 -0
  295. /package/{dist/utils → utils}/get-types/files.d.mts.map +0 -0
  296. /package/{dist/utils → utils}/get-types/multi-select.d.mts +0 -0
  297. /package/{dist/utils → utils}/get-types/multi-select.d.mts.map +0 -0
  298. /package/{dist/utils → utils}/get-types/number.d.mts +0 -0
  299. /package/{dist/utils → utils}/get-types/number.d.mts.map +0 -0
  300. /package/{dist/utils → utils}/get-types/people.d.mts +0 -0
  301. /package/{dist/utils → utils}/get-types/people.d.mts.map +0 -0
  302. /package/{dist/utils → utils}/get-types/phone-number.d.mts +0 -0
  303. /package/{dist/utils → utils}/get-types/phone-number.d.mts.map +0 -0
  304. /package/{dist/utils → utils}/get-types/relation.d.mts +0 -0
  305. /package/{dist/utils → utils}/get-types/relation.d.mts.map +0 -0
  306. /package/{dist/utils → utils}/get-types/rich-text.d.mts +0 -0
  307. /package/{dist/utils → utils}/get-types/rich-text.d.mts.map +0 -0
  308. /package/{dist/utils → utils}/get-types/rollup.d.mts +0 -0
  309. /package/{dist/utils → utils}/get-types/rollup.d.mts.map +0 -0
  310. /package/{dist/utils → utils}/get-types/select.d.mts +0 -0
  311. /package/{dist/utils → utils}/get-types/select.d.mts.map +0 -0
  312. /package/{dist/utils → utils}/get-types/title.d.mts +0 -0
  313. /package/{dist/utils → utils}/get-types/title.d.mts.map +0 -0
  314. /package/{dist/utils → utils}/get-types/url.d.mts +0 -0
  315. /package/{dist/utils → utils}/get-types/url.d.mts.map +0 -0
@@ -1,386 +0,0 @@
1
- type Blog = Record<string, BlogPost>;
2
-
3
- type BlogPost = Default;
4
- type DatabaseInfo = Partial<
5
- Record<
6
- DatabaseType,
7
- {
8
- active: boolean;
9
- database_id: string;
10
- dataTypes: DataTypes[];
11
- // @todo(next-notion) move to `isChild`
12
- hasChild: null | string;
13
- infoType: any;
14
- isChild: null | string;
15
- isChildInfoType: any | null;
16
- name: string;
17
- page_id__seo: string;
18
- routeMeta: boolean;
19
- routeType: string;
20
- skipStaticPaths: boolean;
21
- slug: string;
22
- ttl: number;
23
- }
24
- >
25
- >;
26
-
27
- type Databases = Record<DatabaseType, DatabaseType>;
28
-
29
- type DatabaseType =
30
- | "BLOG"
31
- | "BOOKS"
32
- | "EPISODES"
33
- | "EVENTS"
34
- | "PAGES"
35
- | "PEOPLE"
36
- | "PODCASTS"
37
- | "SEO"
38
- | "SHOWS"
39
- | "VENUES";
40
-
41
- type DataTypes = "LISTING" | "LISTING_BY_DATE" | "SLUG" | "SLUG_BY_ROUTE";
42
-
43
- type DataTypesObject = Record<DataTypes, DataTypes>;
44
- interface Default {
45
- // authors: any
46
- dateCreated?: any;
47
- dateEdited?: any;
48
- datePublished: any;
49
- isIndexed: any;
50
- isPublished: any;
51
- seoDescription: any;
52
- seoImage: any;
53
- seoImageDescription: any;
54
- seoKeywords: any;
55
- slug: any;
56
- title: any;
57
- }
58
- type Direction = "ascending" | "descending";
59
-
60
- interface Episode extends Default {
61
- dateRecorded: any;
62
- duration: any;
63
- episode: any;
64
- mp3: any;
65
- relationEpisodes__People_Guest: any;
66
- relationEpisodes__People_Sound_Engineer: any;
67
- relationEpisodes__People_Thanks: any;
68
- relationEpisodes__Podcasts: any;
69
- relationEpisodes__Venues: any;
70
- // rollupEpisodes__People_Thanks: any
71
- rollupEpisodes__Podcasts: any;
72
- // rollupEpisodes__People_Guest: any
73
- // rollupEpisodes__People_Sound_Engineer: any
74
- rollupEpisodes__PodcastsSlugs: any;
75
- season: any;
76
- // rollupEpisodes__Venues: any
77
- socialApple: any;
78
- socialSpotify: any;
79
- type: any;
80
- }
81
-
82
- type Episodes = Record<string, Episode>;
83
-
84
- interface Event extends Default {
85
- dateEvent: any;
86
- relationEvents__People_Guest: any;
87
- relationEvents__People_Guest_Music: any;
88
- relationEvents__People_Host: any;
89
- relationEvents__Shows: any;
90
- relationEvents__Shows_Lineup: any;
91
- relationEvents__Venues: any;
92
- rollupEvents__People_Cast: any;
93
- rollupEvents__People_Guest: any;
94
- rollupEvents__People_Guest_Music: any;
95
- rollupEvents__People_Host: any;
96
- rollupEvents__Shows: any;
97
- rollupEvents__Shows_Lineup: any;
98
- rollupEvents__Venues: any;
99
- rollupLineup: any;
100
- rollupTags: any;
101
- rollupTagsSecondary: any;
102
- socialFacebook: any;
103
- socialWebsite: any;
104
- ticketUrl: any;
105
- }
106
-
107
- type Events = Record<string, Event>;
108
-
109
- interface NotionAnnotations {
110
- bold: boolean;
111
- code: boolean;
112
- color: string;
113
- italic: boolean;
114
- strikethrough: boolean;
115
- underline: boolean;
116
- }
117
- interface NotionBlock {
118
- created_time: string;
119
- has_children: string;
120
- //
121
- heading_1?: NotionText[];
122
- heading_2?: NotionText[];
123
- heading_3?: NotionText[];
124
- heading_4?: NotionText[];
125
- heading_5?: NotionText[];
126
- heading_6?: NotionText[];
127
- id: string;
128
- image?: NotionImage;
129
- last_edited_time: string;
130
- object: string;
131
- paragraph?: NotionText[];
132
- type: string;
133
- }
134
-
135
- interface NotionImage {
136
- caption?: NotionText;
137
- external?: NotionUrl;
138
- file?: NotionUrl;
139
- type: string;
140
- }
141
- interface NotionText {
142
- annotations: NotionAnnotations;
143
- href: null | string;
144
- plain_text: string;
145
- text: NotionTextContent;
146
- type: string;
147
- }
148
- interface NotionTextContent {
149
- content: string;
150
- link: null | string;
151
- }
152
- interface NotionUrl {
153
- url: string;
154
- }
155
-
156
- type Page = Default;
157
- type Pages = Record<string, Page>;
158
- type People = Record<string, Person>;
159
- interface Person extends Default {
160
- email: any;
161
- nameFirst: any;
162
- nameLast: any;
163
- namePreferred: any;
164
- relationPeople__Episodes_Guest: any;
165
- relationPeople__Episodes_Sound_Engineer: any;
166
- relationPeople__Episodes_Thanks: any;
167
- relationPeople__Events_Guest: any;
168
- relationPeople__Events_Guest_Music: any;
169
- relationPeople__Events_Host: any;
170
- relationPeople__Podcasts_Host: any;
171
- relationPeople__Podcasts_Sound_Engineer: any;
172
- relationPeople__Shows_Cast: any;
173
- relationPeople__Shows_Cast_Past: any;
174
- relationPeople__Shows_Director: any;
175
- relationPeople__Shows_Director_Musical: any;
176
- relationPeople__Shows_Director_Technical: any;
177
- relationPeople__Shows_Producer: any;
178
- relationPeople__Shows_Thanks: any;
179
- relationPeople__Shows_Writer: any;
180
- }
181
- interface Podcast extends Default {
182
- categories: any;
183
- explicit: any;
184
- podcastAuthor: any;
185
- podcastAuthorEmail: any;
186
- relationPodcasts__Episodes: any;
187
- relationPodcasts__People_Host: any;
188
- relationPodcasts__People_Sound_Engineer: any;
189
- rollupPodcasts__Episodes: any;
190
- rollupPodcasts__EpisodesSlugs: any;
191
- socialApple: any;
192
- socialSpotify: any;
193
- type: any;
194
- }
195
- type Podcasts = Record<string, Podcast>;
196
-
197
- interface Property {
198
- format?:
199
- | "baht"
200
- | "canadian_dollar"
201
- | "chilean_peso"
202
- | "colombian_peso"
203
- | "danish_krone"
204
- | "dirham"
205
- | "dollar"
206
- | "euro"
207
- | "forint"
208
- | "franc"
209
- | "hong_kong_dollar"
210
- | "koruna"
211
- | "krona"
212
- | "leu"
213
- | "lira"
214
- | "mexican_peso"
215
- | "new_taiwan_dollar"
216
- | "new_zealand_dollar"
217
- | "norwegian_krone"
218
- | "number"
219
- | "number_with_commas"
220
- | "percent"
221
- | "philippine_peso"
222
- | "pound"
223
- | "rand"
224
- | "real"
225
- | "ringgit"
226
- | "riyal"
227
- | "ruble"
228
- | "rupee"
229
- | "rupiah"
230
- | "shekel"
231
- | "won"
232
- | "yen"
233
- | "yuan"
234
- | "zloty";
235
- init: boolean;
236
- key: string;
237
- notion: string;
238
- relation?: Relation;
239
- rollup?: Rollup;
240
- type:
241
- | "checkbox"
242
- | "created_by"
243
- | "created_time"
244
- | "date"
245
- | "email"
246
- | "files"
247
- | "formula"
248
- | "last_edited_by"
249
- | "last_edited_time"
250
- | "multi_select"
251
- | "number"
252
- | "people"
253
- | "phone_number"
254
- | "relation"
255
- | "rich_text"
256
- | "rollup"
257
- | "select"
258
- | "title"
259
- | "url";
260
- }
261
- interface Relation {
262
- database_id: string;
263
- synced_property_id?: string;
264
- synced_property_name: string;
265
- }
266
- interface Rollup {
267
- function?: RollupFunction;
268
- relation_property_id?: string;
269
- relation_property_name?: string;
270
- rollup_property_id?: string;
271
- rollup_property_name?: string;
272
- }
273
- type RollupFunction =
274
- | "average"
275
- | "count_all"
276
- | "count_empty"
277
- | "count_not_empty"
278
- | "count_unique_values"
279
- | "count_values"
280
- | "max"
281
- | "median"
282
- | "min"
283
- | "percent_empty"
284
- | "percent_not_empty"
285
- | "range"
286
- | "show_original"
287
- | "sum";
288
-
289
- type Seo = Record<string, SeoPost>;
290
- type SeoPost = Default;
291
-
292
- interface Show extends Default {
293
- relationShows__Events: any;
294
- relationShows__Events_Lineup: any;
295
- relationShows__People_Cast: any;
296
- relationShows__People_Cast_Past: any;
297
- relationShows__People_Crew: any;
298
- relationShows__People_Director: any;
299
- relationShows__People_Director_Musical: any;
300
- relationShows__People_Director_Technical: any;
301
- relationShows__People_Producer: any;
302
- relationShows__People_Thanks: any;
303
- relationShows__People_Writer: any;
304
- relationShows__Tags: any;
305
- rollupShows__People_Cast: any;
306
- rollupShows__People_Cast_Past: any;
307
- rollupShows__People_Cast_Slug: any;
308
- rollupShows__People_Crew: any;
309
- rollupShows__People_Director: any;
310
- rollupShows__People_Director_Musical: any;
311
- rollupShows__People_Director_Technical: any;
312
- rollupShows__People_Music: any;
313
- rollupShows__People_Producer: any;
314
- rollupShows__People_Thanks: any;
315
- rollupShows__People_Writer: any;
316
- rollupShows__Tags: any;
317
- socialFacebook: string;
318
- socialInstagram: string;
319
- socialTwitter: string;
320
- socialWebsite: string;
321
- }
322
-
323
- type Shows = Record<string, Show>;
324
-
325
- interface SortItem {
326
- direction: Direction;
327
- property: string;
328
- }
329
-
330
- interface SortMock {
331
- filter?: any[];
332
- sorts: SortItem[];
333
- }
334
-
335
- interface Venue extends Default {
336
- addressCity: any;
337
- addressLatitude: any;
338
- addressLongitude: any;
339
- addressNeighborhood: any;
340
- addressState: any;
341
- addressStreet: any;
342
- addressZipCode: any;
343
- phoneNumber: any;
344
- relationVenues__Episodes: any;
345
- relationVenues__Events: any;
346
- socialFacebook: any;
347
- socialInstagram: any;
348
- socialTwitter: any;
349
- socialWebsite: any;
350
- }
351
-
352
- type Venues = Record<string, Venue>;
353
-
354
- export type {
355
- Blog,
356
- BlogPost,
357
- DatabaseInfo,
358
- Databases,
359
- DatabaseType,
360
- DataTypes,
361
- DataTypesObject,
362
- Direction,
363
- Episode,
364
- Episodes,
365
- Event,
366
- Events,
367
- NotionBlock,
368
- NotionText,
369
- Page,
370
- Pages,
371
- People,
372
- Person,
373
- Podcast,
374
- Podcasts,
375
- Property,
376
- Rollup,
377
- RollupFunction,
378
- Seo,
379
- SeoPost,
380
- Show,
381
- Shows,
382
- SortItem,
383
- SortMock,
384
- Venue,
385
- Venues,
386
- };
@@ -1,16 +0,0 @@
1
- import { addDays as _addDays, addMonths as _addMonths, addYears as _addYears } from "date-fns";
2
-
3
- const addTime = (date, type) => {
4
- switch (type) {
5
- case "day":
6
- // @hack the TimeZone to UTC is ... not great.
7
- return _addDays(date, 2).toISOString();
8
- case "month":
9
- return _addMonths(date, 1).toISOString();
10
- case "year":
11
- return _addYears(date, 1).toISOString();
12
- }
13
- return _addDays(date, -1).toISOString();
14
- };
15
-
16
- export default addTime;
@@ -1,49 +0,0 @@
1
- import { map as _map } from "lodash-es";
2
-
3
- import { LOOKUP, PROPERTIES_LOOKUP } from "../../constants/index";
4
- import { getTypes } from "../../utils/index";
5
-
6
- /**
7
- * @todo(notion)
8
- *
9
- * Refactor to remove `config` as a parameter, or move this to `queries`
10
- */
11
- // oxlint-disable-next-line complexity
12
- const dataNormalized = ({ config, data, pageId, pathVariables }) => {
13
- const { NOTION } = config;
14
- const DATA_NORMALIZED = {};
15
- if (!data?.properties) return DATA_NORMALIZED;
16
- const { properties } = data;
17
-
18
- // @hack(notion) not great
19
- let routeType = "";
20
- if (pathVariables) {
21
- const { meta, routeType: _routeType } = pathVariables;
22
- routeType =
23
- _routeType === NOTION?.PODCASTS?.routeType && meta.length > 1
24
- ? NOTION?.EPISODES?.routeType
25
- : _routeType;
26
- }
27
-
28
- const items = routeType ? LOOKUP[routeType.toUpperCase()] : PROPERTIES_LOOKUP;
29
-
30
- _map(items, (item) => {
31
- let dataToNormalize: any;
32
-
33
- const dataFromNotion = properties[item.notion];
34
- /**
35
- * @note(notion)
36
- * ensure key populates in api
37
- * only populate w/ data if exists in notion
38
- */
39
- DATA_NORMALIZED[item.key] = null;
40
- if (dataFromNotion) {
41
- dataToNormalize = getTypes[item.type](dataFromNotion, pageId);
42
- DATA_NORMALIZED[item.key] = dataToNormalize ? dataToNormalize : null;
43
- }
44
- });
45
-
46
- return DATA_NORMALIZED;
47
- };
48
-
49
- export default dataNormalized;
@@ -1,29 +0,0 @@
1
- import { sortObject } from "@jeromefitz/utils";
2
- import { map as _map, omit as _omit } from "lodash-es";
3
-
4
- import { dataNormalized } from "../../utils/index";
5
-
6
- /**
7
- * @todo(notion)
8
- *
9
- * Refactor after `dataNormalized` to remove `config` as a parameter,
10
- * or move this to `queries`
11
- */
12
- const dataNormalizedResults = ({ config, results, routeType }) => {
13
- const normalizedResults: any[] = [];
14
- _map(results, (result) => {
15
- const normalizedResult = _omit(result, "properties");
16
- normalizedResult.properties = sortObject(
17
- dataNormalized({
18
- config,
19
- data: result,
20
- pageId: result?.id,
21
- pathVariables: routeType,
22
- }),
23
- );
24
- normalizedResults.push(normalizedResult);
25
- });
26
- return normalizedResults;
27
- };
28
-
29
- export default dataNormalizedResults;
@@ -1,62 +0,0 @@
1
- import { DATA_TYPES } from "../../constants/index";
2
-
3
- /**
4
- * @info dataType
5
- * pathVariables via `../../queries/pathVariables`
6
- *
7
- * 1 = (isPage) DATA_TYPES.SLUG
8
- * ex) /about
9
- * /colophon
10
- * /contact
11
- * => routeType = pages
12
- * @note no ability for second tier at the moment for non-db
13
- * otherwise these would have to be `/pages/about`
14
- *
15
- * 2 = (isIndex && !hasMeta) DATA_TYPES.LISTING
16
- * ex) /blog
17
- * /events
18
- * /podcasts
19
- * => routeType = routeType
20
- * @note
21
- * - events should only be "upcoming events"
22
- * - blog should be all-time (handled by pagination)
23
- *
24
- * 3 = (isIndex && hasMeta) DATA_TYPES.LISTING_BY_DATE
25
- * ex) /blog/yyyy
26
- * /blog/yyyy/mm
27
- * /blog/yyyy/mm/dd
28
- * /events/yyyy
29
- * /events/yyyy/mm
30
- * /events/yyyy/mm/dd
31
- * => routeType = routeType
32
- * @note These are each `index` pages for certain routeTypes
33
- *
34
- * 4 = (hasMeta) DATA_TYPES.SLUG_BY_ROUTE
35
- * ex) /blog/yyyy/mm/dd/[slug]
36
- * => parentRouteType = blog
37
- * => routeType = blog
38
- * @note determine [yyyy-mm-dd] from data via slug
39
- * /events/yyyy/mm/dd/[slug],
40
- * => parentRouteType = events
41
- * => routeType = events
42
- * @note determine [yyyy-mm-dd] from data via slug
43
- * /podcasts/[podcasts-slug]/[slug]
44
- * => parentRouteType = podcasts
45
- * => routeType = episodes
46
- * @note determine [podcasts-slug] from data via slug
47
- *
48
- * 5 = (else) DATA_TYPES.SLUG
49
- * ex) /shows/[slug]
50
- * /events/yyyy/mm/dd/[slug]
51
- * /podcasts/[slug]
52
- *
53
- */
54
- const getDataType = ({ hasMeta, isIndex, isPage }) => {
55
- if (isPage) return DATA_TYPES.SLUG;
56
- if (isIndex && !hasMeta) return DATA_TYPES.LISTING;
57
- if (isIndex && hasMeta) return DATA_TYPES.LISTING_BY_DATE;
58
- if (hasMeta) return DATA_TYPES.SLUG_BY_ROUTE;
59
- return DATA_TYPES.SLUG;
60
- };
61
-
62
- export default getDataType;
@@ -1,21 +0,0 @@
1
- import { last as _last } from "lodash-es";
2
-
3
- /**
4
- * @note this should be in the website repo as it’s custom
5
- * *cough* more custom than _waves vaguely all-around_ all of this
6
- */
7
- const getTitle = (title: string) => {
8
- const _title: string = _last(title.split("_")) ?? "";
9
-
10
- // oxlint-disable-next-line no-extra-boolean-cast
11
- if (!!_title) {
12
- return _title
13
- .replace("Past", "Cast Emeritus")
14
- .replace("Musical", "Musical Director")
15
- .replace("Technical", "Technical Director");
16
- }
17
-
18
- return _title;
19
- };
20
-
21
- export default getTitle;
@@ -1,7 +0,0 @@
1
- const _unsupported = (data: any) => {
2
- console.dir(`@notion(_unsupported)`);
3
- // console.dir(data)
4
- return data;
5
- };
6
-
7
- export default _unsupported;
@@ -1,3 +0,0 @@
1
- const checkbox = (data: any) => data.checkbox || false;
2
-
3
- export default checkbox;
@@ -1,6 +0,0 @@
1
- const date = (data: any) => {
2
- const { type } = data;
3
- return data[type];
4
- };
5
-
6
- export default date;
@@ -1,3 +0,0 @@
1
- const email = (data: any) => data.email || null;
2
-
3
- export default email;
@@ -1,67 +0,0 @@
1
- import { stringToUUID } from "@jeromefitz/utils";
2
- import Slugger from "github-slugger";
3
- import { size as _size } from "lodash-es";
4
-
5
- const notionImageHosted = `https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600`;
6
-
7
- const getNotionHostedUrl = (url: boolean | number | string, pageId: string) =>
8
- notionImageHosted
9
- .replace("{{FILENAME}}", encodeURIComponent(url))
10
- .replace("{{PAGE_ID}}", stringToUUID(pageId));
11
-
12
- const files = (data: any, pageId: string) => {
13
- const slugger = new Slugger();
14
- const _files = {};
15
-
16
- if (_size(data.files) <= 0) return _files;
17
- // oxlint-disable-next-line complexity
18
- data.files.map((file: { external: { url: string }; file: { url: string }; type: string }) => {
19
- if (file?.type === "file") {
20
- const internalUrl = file?.file?.url.split("?")[0];
21
- const internalSlug = slugger.slug(internalUrl);
22
- /**
23
- * @note(plaiceholder)
24
- *
25
- * Do not handle here.
26
- */
27
- // const { base64: internalBase64, img: internalImg } = await getPlaiceholder(
28
- // internalUrl
29
- // )
30
- _files[internalSlug] = {
31
- type: file?.type,
32
- url: getNotionHostedUrl(internalUrl, pageId),
33
- // base64: internalBase64,
34
- // img: internalImg,
35
- };
36
- }
37
- if (file?.type === "external") {
38
- const externalUrl = file?.external?.url.split("?")[0];
39
- const externalSlug = slugger.slug(externalUrl);
40
- /**
41
- * @note(plaiceholder)
42
- *
43
- * Do not handle here.
44
- */
45
- // const { base64: externalBase64, img: externalImg } = await getPlaiceholder(
46
- // externalUrl
47
- // )
48
- _files[externalSlug] = {
49
- type: file?.type,
50
- url: externalUrl,
51
- // base64: externalBase64,
52
- // img: externalImg,
53
- };
54
- }
55
- // if (file?.type === 'image') {
56
- // const externalUrl = file?.external?.url.split('?')[0]
57
- // const externalSlug = slugger.slug(externalUrl)
58
- // _files[externalSlug] = { type: file?.type, url: externalUrl }
59
- // }
60
-
61
- // return
62
- });
63
-
64
- return _files;
65
- };
66
-
67
- export default files;
@@ -1,41 +0,0 @@
1
- import _unsupported from "./_unsupported";
2
- import checkbox from "./checkbox";
3
- import date from "./date";
4
- import email from "./email";
5
- import files from "./files";
6
- // import images from './images'
7
- import multi_select from "./multi-select";
8
- import number from "./number";
9
- import people from "./people";
10
- import phone_number from "./phone-number";
11
- import relation from "./relation";
12
- import rich_text from "./rich-text";
13
- import rollup from "./rollup";
14
- import select from "./select";
15
- import title from "./title";
16
- import url from "./url";
17
-
18
- const getTypes = {
19
- checkbox,
20
- created_by: _unsupported,
21
- created_time: date,
22
- date,
23
- email,
24
- files,
25
- formula: _unsupported,
26
- image: files,
27
- last_edited_by: _unsupported,
28
- last_edited_time: date,
29
- multi_select,
30
- number,
31
- people,
32
- phone_number,
33
- relation,
34
- rich_text,
35
- rollup,
36
- select,
37
- title,
38
- url,
39
- };
40
-
41
- export default getTypes;