@jeromefitz/notion 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/constants/index.d.mts +1 -1
  2. package/constants/index.d.mts.map +1 -1
  3. package/constants/index.mjs +1 -1
  4. package/constants/index.mjs.map +1 -1
  5. package/{getTypes-Df5GL8wS.mjs → getTypes-D-cwjcBl.mjs} +1 -1
  6. package/{getTypes-Df5GL8wS.mjs.map → getTypes-D-cwjcBl.mjs.map} +1 -1
  7. package/{index-CvmUSReI.d.mts → index-CQ1IEP2W.d.mts} +1 -1
  8. package/index-CQ1IEP2W.d.mts.map +1 -0
  9. package/index.d.mts +1 -1
  10. package/index.d.mts.map +1 -1
  11. package/index.mjs +1 -1
  12. package/index.mjs.map +1 -1
  13. package/package.json +5 -5
  14. package/queries/getBlocksByIdChildren/index.mjs +1 -1
  15. package/queries/getBlocksByIdChildren/index.mjs.map +1 -1
  16. package/queries/getDatabasesByIdQuery/index.d.mts +1 -1
  17. package/queries/getDatabasesByIdQuery/index.mjs +1 -1
  18. package/queries/getDatabasesByIdQuery/index.mjs.map +1 -1
  19. package/queries/getDeepFetchAllChildren/index.mjs +1 -1
  20. package/queries/getDeepFetchAllChildren/index.mjs.map +1 -1
  21. package/queries/getInfoType/index.mjs +1 -1
  22. package/queries/getInfoType/index.mjs.map +1 -1
  23. package/queries/getNotionListing/index.mjs +1 -1
  24. package/queries/getNotionListing/index.mjs.map +1 -1
  25. package/queries/getNotionListingByDate/index.mjs +1 -1
  26. package/queries/getNotionListingByDate/index.mjs.map +1 -1
  27. package/queries/getNotionSlug/index.mjs +1 -1
  28. package/queries/getNotionSlug/index.mjs.map +1 -1
  29. package/queries/getNotionSlugByRoute/index.mjs +1 -1
  30. package/queries/getNotionSlugByRoute/index.mjs.map +1 -1
  31. package/queries/getPagesById/index.mjs +1 -1
  32. package/queries/getPagesById/index.mjs.map +1 -1
  33. package/queries/getPathVariables/index.d.mts +1 -1
  34. package/queries/getPathVariables/index.mjs +1 -1
  35. package/queries/getPathVariables/index.mjs.map +1 -1
  36. package/queries/getQuery/index.mjs +1 -1
  37. package/queries/getQuery/index.mjs.map +1 -1
  38. package/queries/index.mjs +1 -1
  39. package/schema/index.d.mts +2 -2
  40. package/schema/index.mjs +1 -1
  41. package/utils/addTime/index.d.mts.map +1 -1
  42. package/utils/addTime/index.mjs +1 -1
  43. package/utils/addTime/index.mjs.map +1 -1
  44. package/utils/dataNormalized/index.mjs +1 -1
  45. package/utils/dataNormalizedResults/index.mjs +1 -1
  46. package/utils/getDataType/index.d.mts +1 -1
  47. package/utils/getDataType/index.d.mts.map +1 -1
  48. package/utils/getDataType/index.mjs +1 -1
  49. package/utils/getDataType/index.mjs.map +1 -1
  50. package/utils/getTitle/index.d.mts.map +1 -1
  51. package/utils/getTitle/index.mjs +1 -1
  52. package/utils/getTitle/index.mjs.map +1 -1
  53. package/utils/getTypes/_unsupported.d.mts.map +1 -1
  54. package/utils/getTypes/_unsupported.mjs +1 -1
  55. package/utils/getTypes/_unsupported.mjs.map +1 -1
  56. package/utils/getTypes/checkbox.d.mts.map +1 -1
  57. package/utils/getTypes/checkbox.mjs +1 -1
  58. package/utils/getTypes/checkbox.mjs.map +1 -1
  59. package/utils/getTypes/date.d.mts.map +1 -1
  60. package/utils/getTypes/date.mjs +1 -1
  61. package/utils/getTypes/date.mjs.map +1 -1
  62. package/utils/getTypes/email.d.mts.map +1 -1
  63. package/utils/getTypes/email.mjs +1 -1
  64. package/utils/getTypes/email.mjs.map +1 -1
  65. package/utils/getTypes/files.d.mts.map +1 -1
  66. package/utils/getTypes/files.mjs +1 -1
  67. package/utils/getTypes/files.mjs.map +1 -1
  68. package/utils/getTypes/index.mjs +1 -1
  69. package/utils/getTypes/multi_select.d.mts.map +1 -1
  70. package/utils/getTypes/multi_select.mjs +1 -1
  71. package/utils/getTypes/multi_select.mjs.map +1 -1
  72. package/utils/getTypes/number.d.mts.map +1 -1
  73. package/utils/getTypes/number.mjs +1 -1
  74. package/utils/getTypes/number.mjs.map +1 -1
  75. package/utils/getTypes/people.d.mts.map +1 -1
  76. package/utils/getTypes/people.mjs +1 -1
  77. package/utils/getTypes/people.mjs.map +1 -1
  78. package/utils/getTypes/phone_number.d.mts.map +1 -1
  79. package/utils/getTypes/phone_number.mjs +1 -1
  80. package/utils/getTypes/phone_number.mjs.map +1 -1
  81. package/utils/getTypes/relation.d.mts.map +1 -1
  82. package/utils/getTypes/relation.mjs +1 -1
  83. package/utils/getTypes/rich_text.d.mts.map +1 -1
  84. package/utils/getTypes/rich_text.mjs +1 -1
  85. package/utils/getTypes/rich_text.mjs.map +1 -1
  86. package/utils/getTypes/rollup.d.mts.map +1 -1
  87. package/utils/getTypes/rollup.mjs +1 -1
  88. package/utils/getTypes/select.mjs +1 -1
  89. package/utils/getTypes/select.mjs.map +1 -1
  90. package/utils/getTypes/title.d.mts.map +1 -1
  91. package/utils/getTypes/title.mjs +1 -1
  92. package/utils/getTypes/title.mjs.map +1 -1
  93. package/utils/getTypes/url.d.mts.map +1 -1
  94. package/utils/getTypes/url.mjs +1 -1
  95. package/utils/getTypes/url.mjs.map +1 -1
  96. package/utils/index.mjs +1 -1
  97. package/{utils-bTlwvfkE.mjs → utils-VfbevQkn.mjs} +2 -2
  98. package/{utils-bTlwvfkE.mjs.map → utils-VfbevQkn.mjs.map} +1 -1
  99. package/chunk-pm2C21R4.mjs +0 -1
  100. package/index-CvmUSReI.d.mts.map +0 -1
@@ -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 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,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":"6LAOA,MAAM,EAAmB,MAAO,CAC9B,SACA,wBACA,wBACA,eACA,gBACA,eACI,CACJ,GAAM,CAAE,UAAW,EAEf,EAAY,CAAC,EAEX,EAAU,EAAO,EAAU,YAAY,GAAG,aAC1C,EAAQ,MAAM,EAAa,CAC/B,SACF,CAAC,EAED,GAAI,CAAC,EACH,MAAO,CAAC,EAEN,GAAO,SAAW,SACpB,EAAOA,EAAM,EAAO,YAAY,EAChC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,eAAc,CAAC,CACxE,GAGF,IAAM,EACJ,EAAO,EAAU,YAAY,GAAG,SAAS,QACzC,EAAW,cAAc,OAarB,EACJ,IAAa,EAAW,cAAc,OAClC,IAAI,KAAK,YAAY,EAAE,YAAY,EACnC,IAAI,KAAK,EAAE,YAAY,EAEvB,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,EAAG,CAAC,EAC3D,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,YAAY,GAAG,YAC7C,OAAQ,CACN,IAAK,CACH,CACE,KAAM,CACJ,YAAa,CACf,EACA,UACF,CACF,CACF,CACF,CAAC,EACK,EAAiB,CAAC,EACxB,EAAK,EAAO,QAAU,GAAS,CAC7B,IAAI,EAAW,EACf,EAAWA,EAAM,EAAU,YAAY,EACvC,EAAS,WAAa,EACpB,EAAe,CAAE,SAAQ,KAAM,EAAM,OAAQ,EAAK,GAAI,eAAc,CAAC,CACvE,EACA,EAAQ,KAAK,CAAQ,CAKvB,CAAC,EACD,IAAM,EAAQA,EAAM,EAAQ,SAAS,EAQrC,MAPA,GAAM,QAAU,EAOT,CAAE,UAAS,OAAQ,CAAC,EAAG,OAAM,OAAM,CAC5C"}
@@ -1,2 +1,2 @@
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};
1
+ import{PROPERTIES as e,QUERIES as t}from"../../constants/index.mjs";import n from"../../utils/addTime/index.mjs";import{n as r}from"../../utils-VfbevQkn.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 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,EAAQ,EAAgB,QAAQ,CACzC,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,EAAQ,EAAgB,MAAM,CACvC,CACD,WACD,CACF,CACF,CAOH,QACE,MAAO,CACL,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,GAID,EAAyB,MAAO,CACpC,SACA,wBACA,wBACA,eACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EAEf,EAAe,EAAE,CACnB,EAAY,EAAE,CAEV,EAAU,EAAO,EAAU,aAAa,EAAE,aAC1C,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":"iQASA,MAAM,GAAqC,CACzC,SACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EACb,CAAE,QAAS,EACX,CAAC,EAAM,EAAO,GAAO,EACrB,EAAYA,EAAM,CAAI,EAEtB,EAAgB,IAAI,KAAK,EAAE,YAAY,EACvC,EAAiB,IAAI,KACzB,GAAG,GAAc,EAAc,MAAM,EAAG,CAAC,EAAE,GAAG,GAAgB,KAAK,GACjE,GAAY,MAEhB,EAUM,EACJ,EAAO,EAAU,YAAY,IAAI,UAAU,QAC3C,EAAW,cAAc,OAE3B,OAAQ,EAAR,CAIE,IAAK,GACH,MAAO,CACL,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,EAAE,CACzC,EACA,UACF,EACA,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,MAAM,CACxC,EACA,UACF,CACF,CACF,EAKF,IAAK,GACH,MAAO,CACL,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,EAAE,CACzC,EACA,UACF,EACA,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,OAAO,CACzC,EACA,UACF,CACF,CACF,EAKF,IAAK,GACH,MAAO,CACL,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,EAAE,CACzC,EACA,UACF,EACA,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,KAAK,CACvC,EACA,UACF,CACF,CACF,EAOF,QACE,MAAO,CACL,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,EAAE,CACzC,EACA,UACF,EACA,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,KAAK,CACvC,EACA,UACF,EACA,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,CAAK,CAC5B,CACF,CACF,CACJ,CACF,EAEM,EAAyB,MAAO,CACpC,SACA,wBACA,wBACA,eACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EAEf,EAAe,CAAC,EAClB,EAAY,CAAC,EAET,EAAU,EAAO,EAAU,YAAY,GAAG,aAC1C,EAAQ,MAAM,EAAa,CAC/B,SACF,CAAC,EACG,EAAM,SAAW,SACnB,EAAOC,EAAM,EAAO,YAAY,EAChC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAM,GAAI,eAAc,CAAC,CACzE,GAGF,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,EAAG,CAAC,EAE3D,IAAM,EAAoB,CACxB,CACE,UAAW,aACX,SAAU,EAAW,cAAc,MACrC,CACF,EACM,EAAS,EAAkC,CAC/C,SACA,gBACA,YACA,MACF,CAAC,EAEK,EAAc,EAAO,EAAU,YAAY,GAAG,YAE9C,EAAgB,MAAM,EAAsB,CAChD,cACA,SACA,OACF,CAAC,EACK,EAAiB,CAAC,EACxB,EAAK,EAAS,QAAU,GAAM,CAC5B,IAAM,EAAOA,EAAM,EAAG,YAAY,EAClC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAG,OAAQ,EAAK,GAAI,eAAc,CAAC,CACpE,EACE,GAAQ,EAAQ,KAAK,CAAI,CAC7B,CAAC,EACD,IAAM,EAASA,EAAM,EAAU,SAAS,EACxC,EAAO,QAAU,EACjB,IAAM,EAAQA,EAAM,EAAQ,MAAM,EAOlC,MAAO,CAAE,UAAS,OAAQ,CAAC,EAAG,OAAM,OAAM,CAC5C"}
@@ -1,2 +1,2 @@
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};
1
+ import{QUERIES as e}from"../../constants/index.mjs";import{n as t}from"../../utils-VfbevQkn.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 { 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
+ {"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":"iLAOA,MAAM,EAAgB,MAAO,CAC3B,SACA,wBACA,wBACA,0BACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,UAAW,EAEb,EAAU,GAAW,YAAY,EAGvC,GAAI,CAFY,OAAO,KAAK,CAAM,EAAE,SAAS,CAExC,EAAS,MAAO,CAAE,QAAS,CAAC,EAAG,OAAQ,CAAC,EAAG,KAAM,CAAC,EAAG,MAAO,CAAC,CAAE,EAEpE,IAAM,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,GAAS,YAC7B,OAAQ,CACN,IAAK,CACH,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,CAAK,CAC5B,CACF,CACF,CACF,CAAC,EAEK,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,CAAC,EAGV,IAAM,EAAOA,EAAM,EAAO,YAAY,EAoBtC,MAnBA,GAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,eAAc,CAAC,CACxE,EAiBO,CAAE,SAdO,GAAI,MAAM,EAAwB,CAAE,QAAQ,MADrC,EAAsB,CAAE,SAAU,EAAK,EAAG,CAAC,GACG,OAAQ,CAAC,CAcrE,EAAS,OAAQ,CAAC,EAAG,OAAM,MAAO,CAAC,CAAE,CAChD"}
@@ -1,2 +1,2 @@
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};
1
+ 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-VfbevQkn.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 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,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,QAAS,EAAE,CAAE,OAAQ,EAAE,CAAE,KAAM,EAAE,CAAE,MAAO,EAAE,CAAE,CAEzD,IAAM,EAAOC,EAAM,EAAO,aAAa,CACvC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,gBAAe,CAAC,CACxE,CACD,IAAM,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,GAAI,CAAC,CAC9D,EAAQ,EAAE,CAed,OAVK,IACH,EAAQ,MAAM,EAAS,CACrB,SACA,SAAU,CACR,aAAc,EAAO,GAAO,UAAU,aAAa,CACnD,SAAU,EAAK,GAChB,CACF,CAAC,EAGG,CAAE,UAAS,OAAQ,EAAE,CAAE,OAAM,QAAO,EAavC,EAA6C,MAAO,CACxD,SACA,wBACA,wBAEA,gBACA,YACA,UACI,CACJ,IAAM,EAAgB,IAAI,MAAM,CAAC,aAAa,CAExC,CAAE,UAAW,EACb,CAAE,QAAS,EAEX,CAAC,EAAM,EAAO,GAAO,EAIrB,EAAiB,IAAI,KACzB,GAAG,GAAc,EAAc,MAAM,EAAG,EAAE,CAAC,GAAG,GAAgB,KAAK,GACjE,GAAY,OAEf,CACK,EACJ,EAAO,EAAU,aAAa,GAAG,UAAU,QAC3C,EAAW,cAAc,OAErB,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,aAAa,EAAE,YAC7C,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
+ {"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":"wQAoBA,MAAM,EAAiD,MAAO,CAC5D,SACA,wBACA,wBACA,WACA,gBACA,eAEI,CACJ,GAAM,CAAE,UAAW,EACb,CAAE,QAAS,EAEX,EAAa,EAAU,YAAY,EAEnC,CAAC,EAAY,GAAQ,EACrB,EAAUA,EAAM,CAAI,IAAM,EAE1B,EAAQ,EAAO,IAAa,UAAU,YAAY,EAElD,EAAc,MAAM,EAAsB,CAC9C,YACE,EAAO,EAAU,EAAO,GAAO,UAAU,YAAY,EAAI,GACtD,YACL,OAAQ,CACN,IAAK,CACH,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,EAAU,EAAO,CAAW,CACnD,CACF,CACF,CACF,CAAC,EAEK,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,CAAE,QAAS,CAAC,EAAG,OAAQ,CAAC,EAAG,KAAM,CAAC,EAAG,MAAO,CAAC,CAAE,EAExD,IAAM,EAAOC,EAAM,EAAO,YAAY,EACtC,EAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,eAAc,CAAC,CACxE,EACA,IAAM,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,EAAG,CAAC,EAC7D,EAAQ,CAAC,EAeb,OAVK,IACH,EAAQ,MAAM,EAAS,CACrB,SACA,SAAU,CACR,aAAc,EAAO,GAAO,UAAU,YAAY,EAClD,SAAU,EAAK,EACjB,CACF,CAAC,GAGI,CAAE,UAAS,OAAQ,CAAC,EAAG,OAAM,OAAM,CAC5C,EAYM,EAA6C,MAAO,CACxD,SACA,wBACA,wBAEA,gBACA,YACA,UACI,CACJ,IAAM,EAAgB,IAAI,KAAK,EAAE,YAAY,EAEvC,CAAE,UAAW,EACb,CAAE,QAAS,EAEX,CAAC,EAAM,EAAO,GAAO,EAIrB,EAAiB,IAAI,KACzB,GAAG,GAAc,EAAc,MAAM,EAAG,CAAC,EAAE,GAAG,GAAgB,KAAK,GACjE,GAAY,MAEhB,EACM,EACJ,EAAO,EAAU,YAAY,IAAI,UAAU,QAC3C,EAAW,cAAc,OAErB,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,YAAY,GAAG,YAC7C,OAAQ,CACN,IAAK,CACH,CACE,KAAM,CACJ,YAAa,EAAQ,EAAgB,EAAE,CACzC,EACA,UACF,EACA,CACE,KAAM,CACJ,OAAQ,EAAQ,EAAgB,KAAK,CACvC,EACA,UACF,EACA,CACE,GAAG,EAAQ,KACX,UAAW,CAAE,OAAQ,CAAK,CAC5B,CACF,CACF,CACF,CAAC,EAEK,EAAQ,GAAQ,SAAW,QAAU,EAAO,QAAQ,GAE1D,GAAI,CAAC,EACH,MAAO,CAAE,QAAS,CAAC,EAAG,OAAQ,CAAC,EAAG,KAAM,CAAC,EAAG,MAAO,CAAC,CAAE,EAGxD,IAAM,EAAOA,EAAM,EAAO,YAAY,EAMtC,MALA,GAAK,WAAa,EAChB,EAAe,CAAE,SAAQ,KAAM,EAAO,OAAQ,EAAK,GAAI,eAAc,CAAC,CACxE,EAGO,CAAE,cAFa,EAAsB,CAAE,SAAU,EAAK,EAAG,CAAC,EAE/C,OAAQ,CAAC,EAAG,OAAM,MAAO,CAAC,CAAE,CAChD,EAEM,EAAuB,MAAO,CAClC,SACA,wBACA,wBACA,WACA,gBACA,YACA,UACI,CACJ,GAAM,CAAE,SAAQ,6BAA8B,EAyC9C,OAhCI,EAAO,GAAW,YAAY,IAAI,SAC7B,MAAM,EAA+C,CAC1D,SACA,wBACA,wBACA,WACA,gBACA,WAEF,CAAC,EAQD,EAA0B,EAAW,iBAAiB,SACpD,EAAU,YAAY,CACxB,EAEO,MAAM,EAA2C,CACtD,SACA,wBACA,wBAEA,gBACA,YACA,MACF,CAAC,EAGI,CAAE,QAAS,CAAC,EAAG,OAAQ,CAAC,EAAG,KAAM,CAAC,EAAG,MAAO,CAAC,CAAE,CACxD"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{avoidRateLimit as e,isUndefined as t}from"@jeromefitz/utils";const n=async({getPagesRetrieve:n,page_id:r})=>t(r)?[]:(await e(0),await n({page_id:r}));export{n as default};
1
+ import{avoidRateLimit as e,isUndefined as t}from"@jeromefitz/utils";const n=async({getPagesRetrieve:n,page_id:r})=>t(r)?[]:(await e(0),await n({page_id:r}));export{n as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getPagesById/index.ts"],"sourcesContent":["import { avoidRateLimit, isUndefined } from '@jeromefitz/utils'\n\n// @todo(types)\nconst getPagesById = async ({ getPagesRetrieve, page_id }) => {\n if (isUndefined(page_id)) return []\n await avoidRateLimit(0)\n return await getPagesRetrieve({\n page_id,\n })\n}\n\nexport default getPagesById\n"],"mappings":"qGAGA,MAAM,EAAe,MAAO,CAAE,mBAAkB,aAC1C,EAAY,EAAQ,CAAS,EAAE,EACnC,MAAM,EAAe,EAAE,CAChB,MAAM,EAAiB,CAC5B,UACD,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getPagesById/index.ts"],"sourcesContent":["import { avoidRateLimit, isUndefined } from '@jeromefitz/utils'\n\n// @todo(types)\nconst getPagesById = async ({ getPagesRetrieve, page_id }) => {\n if (isUndefined(page_id)) return []\n await avoidRateLimit(0)\n return await getPagesRetrieve({\n page_id,\n })\n}\n\nexport default getPagesById\n"],"mappings":"oEAGA,MAAM,EAAe,MAAO,CAAE,mBAAkB,aAC1C,EAAY,CAAO,EAAU,CAAC,GAClC,MAAM,EAAe,CAAC,EACf,MAAM,EAAiB,CAC5B,SACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { r as DataTypes } from "../../index-CvmUSReI.mjs";
1
+ import { r as DataTypes } from "../../index-CQ1IEP2W.mjs";
2
2
 
3
3
  //#region src/queries/getPathVariables/index.d.ts
4
4
  declare const getPathVariables: ({
@@ -1,2 +1,2 @@
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};
1
+ import"../../utils-VfbevQkn.mjs";import e from"../../utils/getDataType/index.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
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +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
+ {"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":"wMAiBA,MAAM,GAAoB,CAAE,WAAU,YAAa,CACjD,GAAM,CAAE,SAAQ,kBAAiB,aAAY,eAAgB,EACvDA,EAAeC,EAAM,CAAQ,EAC7BC,EAAaC,EAAO,CAAQ,EAC5B,EAAQD,EAAM,YAAY,EAC1BE,EAAYC,EAAM,CAAQ,EAG1B,EACJL,EAAO,GAAKM,EAAU,EAAY,CAAK,EACnCC,EAAM,CAAQ,EACdA,EAAMC,EAAW,CAAQ,CAAC,EAE1B,EACJN,IAAUE,GAAQ,CAACE,EAAU,EAAa,CAAK,EAAI,EAAO,MAAM,UAAYJ,EAExE,EAAOA,IAAUE,GAAQ,CAACK,EAAW,SAASL,CAAI,CAAC,EAAIA,EAAOF,EAE9D,EAAS,IAAc,EAAO,MAAM,UAAU,YAAY,EAC1D,EAAU,IAASA,EAKnB,EAAgB,CACpB,QALc,CAAC,CAAC,GAAQD,EAAM,CAAI,IAAM,EAMxC,UACA,SACA,OACA,YACA,OACA,IATU,GAAUC,IAAU,EAAkB,GAAKQ,EAAM,EAAU,GAAG,CAU1E,EAKM,EAAW,EAAY,CAAa,EAE1C,MAAO,CACL,GAAG,EACH,UACF,CACF"}
@@ -1,2 +1,2 @@
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};
1
+ import{PROPERTIES as e}from"../../constants/index.mjs";import{t}from"../../utils-VfbevQkn.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
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_map","_omit"],"sources":["../../../src/queries/getQuery/index.ts"],"sourcesContent":["import type { SortItem } from '../../schema/index'\n\nimport { avoidRateLimit, isObjectEmpty } from '@jeromefitz/utils'\n\nimport { map as _map, omit as _omit, size as _size } from 'lodash-es'\n\nimport { PROPERTIES } from '../../constants/index'\nimport dataNormalizedResults from '../../utils/dataNormalizedResults/index'\n\n// const useCache = process.env.NEXT_PUBLIC__NOTION_USE_CACHE\n// const useCache = false\n\nconst SORTS: SortItem[] = [\n {\n direction: 'ascending',\n property: PROPERTIES.slug.notion,\n },\n]\n\n// @todo(complexity) 12\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: migrate\nconst getQuery = async ({ config, notionDatabasesQuery, reqQuery }) => {\n const { NOTION } = config\n const { databaseType } = reqQuery\n const routeType = databaseType\n let hasError = false\n\n /**\n * @setup\n */\n const DATABASE_TYPE = databaseType.toUpperCase()\n const database_id = NOTION[DATABASE_TYPE].database_id\n if (!database_id) return []\n\n // @todo(types) any\n let data: any = {},\n items: any = {}\n let filter: any, sorts: any\n\n /**\n * @todo(notion) move this to the api so it can be re-used\n * not hidden in here all hacky\n *\n * @note(notion) right now only need this for episodes of podcasts\n * _OR_ Related Databases (PODCASTS => EPISODES)\n *\n * This is not needed often and can/should probably be handled instead\n * with Relations & Rollups rather than this customization\n */\n\n if (databaseType === 'EPISODES') {\n sorts = SORTS\n const { podcasts } = reqQuery\n\n // @todo(types)\n const filterTagEpisodesByPodcasts: any = []\n const podcastIds: any = []\n\n // biome-ignore lint/correctness/noUnsafeOptionalChaining: migrate\n !!podcasts && podcastIds.push(...podcasts?.split(','))\n _size(podcastIds) > 0 &&\n _map(podcastIds, (id) =>\n filterTagEpisodesByPodcasts.push({\n property: PROPERTIES.relationEpisodes__Podcasts.notion,\n relation: {\n contains: id,\n },\n }),\n )\n filter = { or: [...filterTagEpisodesByPodcasts] }\n } else {\n // console.dir(`no filter`)\n hasError = true\n }\n\n // /**\n // * @cache pre\n // */\n // if (useCache) {\n // const url = catchAll.join('/')\n // const cacheData = await getCache(url)\n // if (!!cacheData) {\n // data = cacheData\n // }\n // }\n\n if (!hasError && (!data || isObjectEmpty(data))) {\n await avoidRateLimit(0)\n // @todo(types) any\n let contentData: Pick<any, number | string | symbol>\n\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n if (!!filter) {\n // @hack(notion)-do-not-return'\n if (filter?.or.length === 0) {\n filter = {\n and: [\n {\n property: PROPERTIES.slug.notion,\n rich_text: { equals: '@hack(notion)-do-not-return' },\n },\n ],\n }\n }\n contentData = await notionDatabasesQuery({\n database_id,\n filter,\n sorts,\n })\n\n data = contentData\n items = dataNormalizedResults({\n config,\n results: contentData.results,\n routeType,\n })\n data = _omit(data, 'results')\n data.results = items\n } else {\n // console.dir(`no filter`)\n hasError = true\n }\n\n // /**\n // * @cache post\n // */\n // if (useCache && !!data) {\n // const url = catchAll.join('/')\n // // console.dir(url)\n // const isCacheExists = await getCache(url)\n // // console.dir(isCacheExists)\n // if (!isCacheExists || isCacheExists === undefined) {\n // setCache(data, url)\n // }\n // }\n }\n\n return data\n}\n\nexport default getQuery\n"],"mappings":"8RAYA,MAAM,EAAoB,CACxB,CACE,UAAW,YACX,SAAU,EAAW,KAAK,OAC3B,CACF,CAIK,EAAW,MAAO,CAAE,SAAQ,uBAAsB,cAAe,CACrE,GAAM,CAAE,UAAW,EACb,CAAE,gBAAiB,EACnB,EAAY,EACd,EAAW,GAMT,EAAc,EADE,EAAa,aAAa,EACN,YAC1C,GAAI,CAAC,EAAa,MAAO,EAAE,CAG3B,IAAI,EAAY,EAAE,CAChB,EAAa,EAAE,CACb,EAAa,EAajB,GAAI,IAAiB,WAAY,CAC/B,EAAQ,EACR,GAAM,CAAE,YAAa,EAGf,EAAmC,EAAE,CACrC,EAAkB,EAAE,CAGxB,GAAY,EAAW,KAAK,GAAG,GAAU,MAAM,IAAI,CAAC,CACtD,EAAM,EAAW,CAAG,GAClBA,EAAK,EAAa,GAChB,EAA4B,KAAK,CAC/B,SAAU,EAAW,2BAA2B,OAChD,SAAU,CACR,SAAU,EACX,CACF,CAAC,CACH,CACH,EAAS,CAAE,GAAI,CAAC,GAAG,EAA4B,CAAE,MAGjD,EAAW,GAcb,GAAI,CAAC,IAAa,CAAC,GAAQ,EAAc,EAAK,EAAG,CAC/C,MAAM,EAAe,EAAE,CAEvB,IAAI,EAGE,GAEA,GAAQ,GAAG,SAAW,IACxB,EAAS,CACP,IAAK,CACH,CACE,SAAU,EAAW,KAAK,OAC1B,UAAW,CAAE,OAAQ,8BAA+B,CACrD,CACF,CACF,EAEH,EAAc,MAAM,EAAqB,CACvC,cACA,SACA,QACD,CAAC,CAEF,EAAO,EACP,EAAQ,EAAsB,CAC5B,SACA,QAAS,EAAY,QACrB,YACD,CAAC,CACF,EAAOC,EAAM,EAAM,UAAU,CAC7B,EAAK,QAAU,GAGf,EAAW,GAiBf,OAAO"}
1
+ {"version":3,"file":"index.mjs","names":["_map","_omit"],"sources":["../../../src/queries/getQuery/index.ts"],"sourcesContent":["import type { SortItem } from '../../schema/index'\n\nimport { avoidRateLimit, isObjectEmpty } from '@jeromefitz/utils'\n\nimport { map as _map, omit as _omit, size as _size } from 'lodash-es'\n\nimport { PROPERTIES } from '../../constants/index'\nimport dataNormalizedResults from '../../utils/dataNormalizedResults/index'\n\n// const useCache = process.env.NEXT_PUBLIC__NOTION_USE_CACHE\n// const useCache = false\n\nconst SORTS: SortItem[] = [\n {\n direction: 'ascending',\n property: PROPERTIES.slug.notion,\n },\n]\n\n// @todo(complexity) 12\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: migrate\nconst getQuery = async ({ config, notionDatabasesQuery, reqQuery }) => {\n const { NOTION } = config\n const { databaseType } = reqQuery\n const routeType = databaseType\n let hasError = false\n\n /**\n * @setup\n */\n const DATABASE_TYPE = databaseType.toUpperCase()\n const database_id = NOTION[DATABASE_TYPE].database_id\n if (!database_id) return []\n\n // @todo(types) any\n let data: any = {},\n items: any = {}\n let filter: any, sorts: any\n\n /**\n * @todo(notion) move this to the api so it can be re-used\n * not hidden in here all hacky\n *\n * @note(notion) right now only need this for episodes of podcasts\n * _OR_ Related Databases (PODCASTS => EPISODES)\n *\n * This is not needed often and can/should probably be handled instead\n * with Relations & Rollups rather than this customization\n */\n\n if (databaseType === 'EPISODES') {\n sorts = SORTS\n const { podcasts } = reqQuery\n\n // @todo(types)\n const filterTagEpisodesByPodcasts: any = []\n const podcastIds: any = []\n\n // biome-ignore lint/correctness/noUnsafeOptionalChaining: migrate\n !!podcasts && podcastIds.push(...podcasts?.split(','))\n _size(podcastIds) > 0 &&\n _map(podcastIds, (id) =>\n filterTagEpisodesByPodcasts.push({\n property: PROPERTIES.relationEpisodes__Podcasts.notion,\n relation: {\n contains: id,\n },\n }),\n )\n filter = { or: [...filterTagEpisodesByPodcasts] }\n } else {\n // console.dir(`no filter`)\n hasError = true\n }\n\n // /**\n // * @cache pre\n // */\n // if (useCache) {\n // const url = catchAll.join('/')\n // const cacheData = await getCache(url)\n // if (!!cacheData) {\n // data = cacheData\n // }\n // }\n\n if (!hasError && (!data || isObjectEmpty(data))) {\n await avoidRateLimit(0)\n // @todo(types) any\n let contentData: Pick<any, number | string | symbol>\n\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n if (!!filter) {\n // @hack(notion)-do-not-return'\n if (filter?.or.length === 0) {\n filter = {\n and: [\n {\n property: PROPERTIES.slug.notion,\n rich_text: { equals: '@hack(notion)-do-not-return' },\n },\n ],\n }\n }\n contentData = await notionDatabasesQuery({\n database_id,\n filter,\n sorts,\n })\n\n data = contentData\n items = dataNormalizedResults({\n config,\n results: contentData.results,\n routeType,\n })\n data = _omit(data, 'results')\n data.results = items\n } else {\n // console.dir(`no filter`)\n hasError = true\n }\n\n // /**\n // * @cache post\n // */\n // if (useCache && !!data) {\n // const url = catchAll.join('/')\n // // console.dir(url)\n // const isCacheExists = await getCache(url)\n // // console.dir(isCacheExists)\n // if (!isCacheExists || isCacheExists === undefined) {\n // setCache(data, url)\n // }\n // }\n }\n\n return data\n}\n\nexport default getQuery\n"],"mappings":"yNAYA,MAAM,EAAoB,CACxB,CACE,UAAW,YACX,SAAU,EAAW,KAAK,MAC5B,CACF,EAIM,EAAW,MAAO,CAAE,SAAQ,uBAAsB,cAAe,CACrE,GAAM,CAAE,UAAW,EACb,CAAE,gBAAiB,EACnB,EAAY,EACd,EAAW,GAMT,EAAc,EADE,EAAa,YACR,GAAe,YAC1C,GAAI,CAAC,EAAa,MAAO,CAAC,EAG1B,IAAI,EAAY,CAAC,EACf,EAAa,CAAC,EACZ,EAAa,EAajB,GAAI,IAAiB,WAAY,CAC/B,EAAQ,EACR,GAAM,CAAE,YAAa,EAGf,EAAmC,CAAC,EACpC,EAAkB,CAAC,EAGvB,GAAY,EAAW,KAAK,GAAG,GAAU,MAAM,GAAG,CAAC,EACrD,EAAM,CAAU,EAAI,GAClBA,EAAK,EAAa,GAChB,EAA4B,KAAK,CAC/B,SAAU,EAAW,2BAA2B,OAChD,SAAU,CACR,SAAU,CACZ,CACF,CAAC,CACH,EACF,EAAS,CAAE,GAAI,CAAC,GAAG,CAA2B,CAAE,CAClD,MAEE,EAAW,GAcb,GAAI,CAAC,IAAa,CAAC,GAAQ,EAAc,CAAI,GAAI,CAC/C,MAAM,EAAe,CAAC,EAEtB,IAAI,EAGE,GAEA,GAAQ,GAAG,SAAW,IACxB,EAAS,CACP,IAAK,CACH,CACE,SAAU,EAAW,KAAK,OAC1B,UAAW,CAAE,OAAQ,6BAA8B,CACrD,CACF,CACF,GAEF,EAAc,MAAM,EAAqB,CACvC,cACA,SACA,OACF,CAAC,EAED,EAAO,EACP,EAAQ,EAAsB,CAC5B,SACA,QAAS,EAAY,QACrB,WACF,CAAC,EACD,EAAOC,EAAM,EAAM,SAAS,EAC5B,EAAK,QAAU,GAGf,EAAW,EAef,CAEA,OAAO,CACT"}
package/queries/index.mjs CHANGED
@@ -1 +1 @@
1
- import"../chunk-pm2C21R4.mjs";import e from"./getBlocksByIdChildren/index.mjs";import t from"./getDatabasesByIdQuery/index.mjs";import n from"./getDeepFetchAllChildren/index.mjs";import r from"./getInfoType/index.mjs";import"../utils-bTlwvfkE.mjs";import"../getTypes-Df5GL8wS.mjs";import i from"./getNotionListing/index.mjs";import a from"./getNotionListingByDate/index.mjs";import o from"./getNotionSlug/index.mjs";import s from"./getNotionSlugByRoute/index.mjs";import c from"./getPagesById/index.mjs";import l from"./getPathVariables/index.mjs";import u from"./getQuery/index.mjs";export{e as getBlocksByIdChildren,t as getDatabasesByIdQuery,n as getDeepFetchAllChildren,r as getInfoType,i as getNotionListing,a as getNotionListingByDate,o as getNotionSlug,s as getNotionSlugByRoute,c as getPagesById,l as getPathVariables,u as getQuery};
1
+ import e from"./getBlocksByIdChildren/index.mjs";import t from"./getDatabasesByIdQuery/index.mjs";import n from"./getDeepFetchAllChildren/index.mjs";import r from"./getInfoType/index.mjs";import i from"./getNotionListing/index.mjs";import a from"./getNotionListingByDate/index.mjs";import o from"./getNotionSlug/index.mjs";import s from"./getNotionSlugByRoute/index.mjs";import c from"./getPagesById/index.mjs";import l from"./getPathVariables/index.mjs";import u from"./getQuery/index.mjs";export{e as getBlocksByIdChildren,t as getDatabasesByIdQuery,n as getDeepFetchAllChildren,r as getInfoType,i as getNotionListing,a as getNotionListingByDate,o as getNotionSlug,s as getNotionSlugByRoute,c as getPagesById,l as getPathVariables,u as getQuery};
@@ -1,2 +1,2 @@
1
- import { A as Venue, C as RollupFunction, D as Shows, E as Show, O as SortItem, S as Rollup, T as SeoPost, _ as People, a as DatabaseInfo, b as Podcasts, c as Direction, d as Event, f as Events, g as Pages, h as Page, i as DataTypesObject, j as Venues, k as SortMock, l as Episode, m as NotionText, n as BlogPost, o as DatabaseType, p as NotionBlock, r as DataTypes, s as Databases, t as Blog, u as Episodes, v as Person, w as Seo, x as Property, y as Podcast } from "../index-CvmUSReI.mjs";
2
- export { Blog, BlogPost, DataTypes, DataTypesObject, DatabaseInfo, DatabaseType, Databases, Direction, Episode, Episodes, Event, Events, NotionBlock, NotionText, Page, Pages, People, Person, Podcast, Podcasts, Property, Rollup, RollupFunction, Seo, SeoPost, Show, Shows, SortItem, SortMock, Venue, Venues };
1
+ import { A as Venue, C as RollupFunction, D as Shows, E as Show, O as SortItem, S as Rollup, T as SeoPost, _ as People, a as DatabaseInfo, b as Podcasts, c as Direction, d as Event, f as Events, g as Pages, h as Page, i as DataTypesObject, j as Venues, k as SortMock, l as Episode, m as NotionText, n as BlogPost, o as DatabaseType, p as NotionBlock, r as DataTypes, s as Databases, t as Blog, u as Episodes, v as Person, w as Seo, x as Property, y as Podcast } from "../index-CQ1IEP2W.mjs";
2
+ export type { Blog, BlogPost, DataTypes, DataTypesObject, DatabaseInfo, DatabaseType, Databases, Direction, Episode, Episodes, Event, Events, NotionBlock, NotionText, Page, Pages, People, Person, Podcast, Podcasts, Property, Rollup, RollupFunction, Seo, SeoPost, Show, Shows, SortItem, SortMock, Venue, Venues };
package/schema/index.mjs CHANGED
@@ -1 +1 @@
1
- import"../chunk-pm2C21R4.mjs";export{};
1
+ export{};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/addTime/index.ts"],"mappings":";cAMM,OAAA,GAAW,IAAA,OAAM,IAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/addTime/index.ts"],"mappings":";cAMM,OAAA,GAAW,IAAA,OAAM,IAAI"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{addDays as e,addMonths as t,addYears as n}from"date-fns";const r=(r,i)=>{switch(i){case`day`:return e(r,2).toISOString();case`month`:return t(r,1).toISOString();case`year`:return n(r,1).toISOString()}return e(r,-1).toISOString()};export{r as default};
1
+ import{addDays as e,addMonths as t,addYears as n}from"date-fns";const r=(r,i)=>{switch(i){case`day`:return e(r,2).toISOString();case`month`:return t(r,1).toISOString();case`year`:return n(r,1).toISOString()}return e(r,-1).toISOString()};export{r as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_addDays","_addMonths","_addYears"],"sources":["../../../src/utils/addTime/index.ts"],"sourcesContent":["import {\n addDays as _addDays,\n addMonths as _addMonths,\n addYears as _addYears,\n} from 'date-fns'\n\nconst addTime = (date, type) => {\n switch (type) {\n case 'day':\n // @hack the TimeZone to UTC is ... not great.\n return _addDays(date, 2).toISOString()\n case 'month':\n return _addMonths(date, 1).toISOString()\n case 'year':\n return _addYears(date, 1).toISOString()\n }\n return _addDays(date, -1).toISOString()\n}\n\nexport default addTime\n"],"mappings":"iGAMA,MAAM,GAAW,EAAM,IAAS,CAC9B,OAAQ,EAAR,CACE,IAAK,MAEH,OAAOA,EAAS,EAAM,EAAE,CAAC,aAAa,CACxC,IAAK,QACH,OAAOC,EAAW,EAAM,EAAE,CAAC,aAAa,CAC1C,IAAK,OACH,OAAOC,EAAU,EAAM,EAAE,CAAC,aAAa,CAE3C,OAAOF,EAAS,EAAM,GAAG,CAAC,aAAa"}
1
+ {"version":3,"file":"index.mjs","names":["_addDays","_addMonths","_addYears"],"sources":["../../../src/utils/addTime/index.ts"],"sourcesContent":["import {\n addDays as _addDays,\n addMonths as _addMonths,\n addYears as _addYears,\n} from 'date-fns'\n\nconst addTime = (date, type) => {\n switch (type) {\n case 'day':\n // @hack the TimeZone to UTC is ... not great.\n return _addDays(date, 2).toISOString()\n case 'month':\n return _addMonths(date, 1).toISOString()\n case 'year':\n return _addYears(date, 1).toISOString()\n }\n return _addDays(date, -1).toISOString()\n}\n\nexport default addTime\n"],"mappings":"gEAMA,MAAM,GAAW,EAAM,IAAS,CAC9B,OAAQ,EAAR,CACE,IAAK,MAEH,OAAOA,EAAS,EAAM,CAAC,EAAE,YAAY,EACvC,IAAK,QACH,OAAOC,EAAW,EAAM,CAAC,EAAE,YAAY,EACzC,IAAK,OACH,OAAOC,EAAU,EAAM,CAAC,EAAE,YAAY,CAC1C,CACA,OAAOF,EAAS,EAAM,EAAE,EAAE,YAAY,CACxC"}
@@ -1 +1 @@
1
- import"../../chunk-pm2C21R4.mjs";import{n as e}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";export{e as default};
1
+ import{n as e}from"../../utils-VfbevQkn.mjs";export{e as default};
@@ -1 +1 @@
1
- import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../utils-bTlwvfkE.mjs";import"../../getTypes-Df5GL8wS.mjs";export{e as default};
1
+ import{t as e}from"../../utils-VfbevQkn.mjs";export{e as default};
@@ -1,4 +1,4 @@
1
- import { r as DataTypes } from "../../index-CvmUSReI.mjs";
1
+ import { r as DataTypes } from "../../index-CQ1IEP2W.mjs";
2
2
 
3
3
  //#region src/utils/getDataType/index.d.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/getDataType/index.ts"],"mappings":";;;;;;;AAqDiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA3C,WAAA;EAAe,OAAA;EAAA,OAAA;EAAA;AAAA;;;;MAAA,SAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/getDataType/index.ts"],"mappings":";;;;;;AAqDiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA3C,WAAA;EAAe,OAAA;EAAA,OAAA;EAAA;AAAA;;;;MAAA,SAAA"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{DATA_TYPES as e}from"../../constants/index.mjs";const t=({hasMeta:t,isIndex:n,isPage:r})=>r?e.SLUG:n&&!t?e.LISTING:n&&t?e.LISTING_BY_DATE:t?e.SLUG_BY_ROUTE:e.SLUG;export{t as default};
1
+ import{DATA_TYPES as e}from"../../constants/index.mjs";const t=({hasMeta:t,isIndex:n,isPage:r})=>r?e.SLUG:n&&!t?e.LISTING:n&&t?e.LISTING_BY_DATE:t?e.SLUG_BY_ROUTE:e.SLUG;export{t as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/getDataType/index.ts"],"sourcesContent":["import { DATA_TYPES } from '../../constants/index'\n\n/**\n * @info dataType\n * pathVariables via `../../queries/pathVariables`\n *\n * 1 = (isPage) DATA_TYPES.SLUG\n * ex) /about\n * /colophon\n * /contact\n * => routeType = pages\n * @note no ability for second tier at the moment for non-db\n * otherwise these would have to be `/pages/about`\n *\n * 2 = (isIndex && !hasMeta) DATA_TYPES.LISTING\n * ex) /blog\n * /events\n * /podcasts\n * => routeType = routeType\n * @note\n * - events should only be \"upcoming events\"\n * - blog should be all-time (handled by pagination)\n *\n * 3 = (isIndex && hasMeta) DATA_TYPES.LISTING_BY_DATE\n * ex) /blog/yyyy\n * /blog/yyyy/mm\n * /blog/yyyy/mm/dd\n * /events/yyyy\n * /events/yyyy/mm\n * /events/yyyy/mm/dd\n * => routeType = routeType\n * @note These are each `index` pages for certain routeTypes\n *\n * 4 = (hasMeta) DATA_TYPES.SLUG_BY_ROUTE\n * ex) /blog/yyyy/mm/dd/[slug]\n * => parentRouteType = blog\n * => routeType = blog\n * @note determine [yyyy-mm-dd] from data via slug\n * /events/yyyy/mm/dd/[slug],\n * => parentRouteType = events\n * => routeType = events\n * @note determine [yyyy-mm-dd] from data via slug\n * /podcasts/[podcasts-slug]/[slug]\n * => parentRouteType = podcasts\n * => routeType = episodes\n * @note determine [podcasts-slug] from data via slug\n *\n * 5 = (else) DATA_TYPES.SLUG\n * ex) /shows/[slug]\n * /events/yyyy/mm/dd/[slug]\n * /podcasts/[slug]\n *\n */\nconst getDataType = ({ hasMeta, isIndex, isPage }) => {\n if (isPage) return DATA_TYPES.SLUG\n if (isIndex && !hasMeta) return DATA_TYPES.LISTING\n if (isIndex && hasMeta) return DATA_TYPES.LISTING_BY_DATE\n if (hasMeta) return DATA_TYPES.SLUG_BY_ROUTE\n return DATA_TYPES.SLUG\n}\n\nexport default getDataType\n"],"mappings":"wFAqDA,MAAM,GAAe,CAAE,UAAS,UAAS,YACnC,EAAe,EAAW,KAC1B,GAAW,CAAC,EAAgB,EAAW,QACvC,GAAW,EAAgB,EAAW,gBACtC,EAAgB,EAAW,cACxB,EAAW"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/getDataType/index.ts"],"sourcesContent":["import { DATA_TYPES } from '../../constants/index'\n\n/**\n * @info dataType\n * pathVariables via `../../queries/pathVariables`\n *\n * 1 = (isPage) DATA_TYPES.SLUG\n * ex) /about\n * /colophon\n * /contact\n * => routeType = pages\n * @note no ability for second tier at the moment for non-db\n * otherwise these would have to be `/pages/about`\n *\n * 2 = (isIndex && !hasMeta) DATA_TYPES.LISTING\n * ex) /blog\n * /events\n * /podcasts\n * => routeType = routeType\n * @note\n * - events should only be \"upcoming events\"\n * - blog should be all-time (handled by pagination)\n *\n * 3 = (isIndex && hasMeta) DATA_TYPES.LISTING_BY_DATE\n * ex) /blog/yyyy\n * /blog/yyyy/mm\n * /blog/yyyy/mm/dd\n * /events/yyyy\n * /events/yyyy/mm\n * /events/yyyy/mm/dd\n * => routeType = routeType\n * @note These are each `index` pages for certain routeTypes\n *\n * 4 = (hasMeta) DATA_TYPES.SLUG_BY_ROUTE\n * ex) /blog/yyyy/mm/dd/[slug]\n * => parentRouteType = blog\n * => routeType = blog\n * @note determine [yyyy-mm-dd] from data via slug\n * /events/yyyy/mm/dd/[slug],\n * => parentRouteType = events\n * => routeType = events\n * @note determine [yyyy-mm-dd] from data via slug\n * /podcasts/[podcasts-slug]/[slug]\n * => parentRouteType = podcasts\n * => routeType = episodes\n * @note determine [podcasts-slug] from data via slug\n *\n * 5 = (else) DATA_TYPES.SLUG\n * ex) /shows/[slug]\n * /events/yyyy/mm/dd/[slug]\n * /podcasts/[slug]\n *\n */\nconst getDataType = ({ hasMeta, isIndex, isPage }) => {\n if (isPage) return DATA_TYPES.SLUG\n if (isIndex && !hasMeta) return DATA_TYPES.LISTING\n if (isIndex && hasMeta) return DATA_TYPES.LISTING_BY_DATE\n if (hasMeta) return DATA_TYPES.SLUG_BY_ROUTE\n return DATA_TYPES.SLUG\n}\n\nexport default getDataType\n"],"mappings":"uDAqDA,MAAM,GAAe,CAAE,UAAS,UAAS,YACnC,EAAe,EAAW,KAC1B,GAAW,CAAC,EAAgB,EAAW,QACvC,GAAW,EAAgB,EAAW,gBACtC,EAAgB,EAAW,cACxB,EAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/getTitle/index.ts"],"mappings":";;;;;cAMM,QAAA,GAAY,KAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/getTitle/index.ts"],"mappings":";;;;;cAMM,QAAA,GAAY,KAAa"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{last as e}from"lodash-es";const t=t=>{let n=e(t.split(`_`))??``;return n&&n.replace(`Past`,`Cast Emeritus`).replace(`Musical`,`Musical Director`).replace(`Technical`,`Technical Director`)};export{t as default};
1
+ import{last as e}from"lodash-es";const t=t=>{let n=e(t.split(`_`))??``;return n&&n.replace(`Past`,`Cast Emeritus`).replace(`Musical`,`Musical Director`).replace(`Technical`,`Technical Director`)};export{t as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_last"],"sources":["../../../src/utils/getTitle/index.ts"],"sourcesContent":["import { last as _last } from 'lodash-es'\n\n/**\n * @note this should be in the website repo as it’s custom\n * *cough* more custom than _waves vaguely all-around_ all of this\n */\nconst getTitle = (title: string) => {\n const _title: string = _last(title.split('_')) ?? ''\n\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n if (!!_title) {\n return _title\n .replace('Past', 'Cast Emeritus')\n .replace('Musical', 'Musical Director')\n .replace('Technical', 'Technical Director')\n }\n\n return _title\n}\n\nexport default getTitle\n"],"mappings":"kEAMA,MAAM,EAAY,GAAkB,CAClC,IAAM,EAAiBA,EAAM,EAAM,MAAM,IAAI,CAAC,EAAI,GAUlD,OAPM,GACG,EACJ,QAAQ,OAAQ,gBAAgB,CAChC,QAAQ,UAAW,mBAAmB,CACtC,QAAQ,YAAa,qBAAqB"}
1
+ {"version":3,"file":"index.mjs","names":["_last"],"sources":["../../../src/utils/getTitle/index.ts"],"sourcesContent":["import { last as _last } from 'lodash-es'\n\n/**\n * @note this should be in the website repo as it’s custom\n * *cough* more custom than _waves vaguely all-around_ all of this\n */\nconst getTitle = (title: string) => {\n const _title: string = _last(title.split('_')) ?? ''\n\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n if (!!_title) {\n return _title\n .replace('Past', 'Cast Emeritus')\n .replace('Musical', 'Musical Director')\n .replace('Technical', 'Technical Director')\n }\n\n return _title\n}\n\nexport default getTitle\n"],"mappings":"iCAMA,MAAM,EAAY,GAAkB,CAClC,IAAM,EAAiBA,EAAM,EAAM,MAAM,GAAG,CAAC,GAAK,GAUlD,OAPM,GACG,EACJ,QAAQ,OAAQ,eAAe,EAC/B,QAAQ,UAAW,kBAAkB,EACrC,QAAQ,YAAa,oBAAoB,CAIhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"_unsupported.d.mts","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"mappings":";;cACM,YAAA,GAAgB,IAAA"}
1
+ {"version":3,"file":"_unsupported.d.mts","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"mappings":";;cACM,YAAA,GAAgB,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>(console.dir(`@notion(_unsupported)`),e);export{e as default};
1
+ const e=e=>(console.dir(`@notion(_unsupported)`),e);export{e as default};
2
2
  //# sourceMappingURL=_unsupported.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"_unsupported.mjs","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noConsole: migrate */\nconst _unsupported = (data: any) => {\n console.dir(`@notion(_unsupported)`)\n // console.dir(data)\n return data\n}\n\nexport default _unsupported\n"],"mappings":"iCACA,MAAM,EAAgB,IACpB,QAAQ,IAAI,wBAAwB,CAE7B"}
1
+ {"version":3,"file":"_unsupported.mjs","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noConsole: migrate */\nconst _unsupported = (data: any) => {\n console.dir(`@notion(_unsupported)`)\n // console.dir(data)\n return data\n}\n\nexport default _unsupported\n"],"mappings":"AACA,MAAM,EAAgB,IACpB,QAAQ,IAAI,uBAAuB,EAE5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.mts","names":[],"sources":["../../../src/utils/getTypes/checkbox.ts"],"mappings":";cAAM,QAAA,GAAY,IAAA"}
1
+ {"version":3,"file":"checkbox.d.mts","names":[],"sources":["../../../src/utils/getTypes/checkbox.ts"],"mappings":";cAAM,QAAA,GAAY,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>e.checkbox||!1;export{e as default};
1
+ const e=e=>e.checkbox||!1;export{e as default};
2
2
  //# sourceMappingURL=checkbox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.mjs","names":[],"sources":["../../../src/utils/getTypes/checkbox.ts"],"sourcesContent":["const checkbox = (data: any) => data.checkbox || false\n\nexport default checkbox\n"],"mappings":"iCAAA,MAAM,EAAY,GAAc,EAAK,UAAY"}
1
+ {"version":3,"file":"checkbox.mjs","names":[],"sources":["../../../src/utils/getTypes/checkbox.ts"],"sourcesContent":["const checkbox = (data: any) => data.checkbox || false\n\nexport default checkbox\n"],"mappings":"AAAA,MAAM,EAAY,GAAc,EAAK,UAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.mts","names":[],"sources":["../../../src/utils/getTypes/date.ts"],"mappings":";cAAM,IAAA,GAAQ,IAAA"}
1
+ {"version":3,"file":"date.d.mts","names":[],"sources":["../../../src/utils/getTypes/date.ts"],"mappings":";cAAM,IAAA,GAAQ,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>{let{type:t}=e;return e[t]};export{e as default};
1
+ const e=e=>{let{type:t}=e;return e[t]};export{e as default};
2
2
  //# sourceMappingURL=date.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.mjs","names":[],"sources":["../../../src/utils/getTypes/date.ts"],"sourcesContent":["const date = (data: any) => {\n const { type } = data\n return data[type]\n}\n\nexport default date\n"],"mappings":"iCAAA,MAAM,EAAQ,GAAc,CAC1B,GAAM,CAAE,QAAS,EACjB,OAAO,EAAK"}
1
+ {"version":3,"file":"date.mjs","names":[],"sources":["../../../src/utils/getTypes/date.ts"],"sourcesContent":["const date = (data: any) => {\n const { type } = data\n return data[type]\n}\n\nexport default date\n"],"mappings":"AAAA,MAAM,EAAQ,GAAc,CAC1B,GAAM,CAAE,QAAS,EACjB,OAAO,EAAK,EACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.mts","names":[],"sources":["../../../src/utils/getTypes/email.ts"],"mappings":";cAAM,KAAA,GAAS,IAAA"}
1
+ {"version":3,"file":"email.d.mts","names":[],"sources":["../../../src/utils/getTypes/email.ts"],"mappings":";cAAM,KAAA,GAAS,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>e.email||null;export{e as default};
1
+ const e=e=>e.email||null;export{e as default};
2
2
  //# sourceMappingURL=email.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.mjs","names":[],"sources":["../../../src/utils/getTypes/email.ts"],"sourcesContent":["const email = (data: any) => data.email || null\n\nexport default email\n"],"mappings":"iCAAA,MAAM,EAAS,GAAc,EAAK,OAAS"}
1
+ {"version":3,"file":"email.mjs","names":[],"sources":["../../../src/utils/getTypes/email.ts"],"sourcesContent":["const email = (data: any) => data.email || null\n\nexport default email\n"],"mappings":"AAAA,MAAM,EAAS,GAAc,EAAK,OAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.mts","names":[],"sources":["../../../src/utils/getTypes/files.ts"],"mappings":";cAYM,KAAA,GAAS,IAAA,OAAW,MAAA"}
1
+ {"version":3,"file":"files.d.mts","names":[],"sources":["../../../src/utils/getTypes/files.ts"],"mappings":";cAYM,KAAA,GAAS,IAAA,OAAW,MAAc"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{size as e}from"lodash-es";import{stringToUUID as t}from"@jeromefitz/utils";import n from"github-slugger";const r=(e,n)=>`https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600`.replace(`{{FILENAME}}`,encodeURIComponent(e)).replace(`{{PAGE_ID}}`,t(n)),i=(t,i)=>{let a=new n,o={};return e(t.files)<=0||t.files.map(e=>{if(e?.type===`file`){let t=e?.file?.url.split(`?`)[0],n=a.slug(t);o[n]={type:e?.type,url:r(t,i)}}if(e?.type===`external`){let t=e?.external?.url.split(`?`)[0],n=a.slug(t);o[n]={type:e?.type,url:t}}}),o};export{i as default};
1
+ import{size as e}from"lodash-es";import{stringToUUID as t}from"@jeromefitz/utils";import n from"github-slugger";const r=(e,n)=>`https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600`.replace(`{{FILENAME}}`,encodeURIComponent(e)).replace(`{{PAGE_ID}}`,t(n)),i=(t,i)=>{let a=new n,o={};return e(t.files)<=0||t.files.map(e=>{if(e?.type===`file`){let t=e?.file?.url.split(`?`)[0],n=a.slug(t);o[n]={type:e?.type,url:r(t,i)}}if(e?.type===`external`){let t=e?.external?.url.split(`?`)[0],n=a.slug(t);o[n]={type:e?.type,url:t}}}),o};export{i as default};
2
2
  //# sourceMappingURL=files.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.mjs","names":["_size"],"sources":["../../../src/utils/getTypes/files.ts"],"sourcesContent":["import { stringToUUID } from '@jeromefitz/utils'\n\nimport Slugger from 'github-slugger'\nimport { size as _size } from 'lodash-es'\n\nconst notionImageHosted = `https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600`\n\nconst getNotionHostedUrl = (url: boolean | number | string, pageId: string) =>\n notionImageHosted\n .replace('{{FILENAME}}', encodeURIComponent(url))\n .replace('{{PAGE_ID}}', stringToUUID(pageId))\n\nconst files = (data: any, pageId: string) => {\n const slugger = new Slugger()\n const _files = {}\n\n if (_size(data.files) <= 0) return _files\n data.files.map(\n (file: { external: { url: string }; file: { url: string }; type: string }) => {\n if (file?.type === 'file') {\n const internalUrl = file?.file?.url.split('?')[0]\n const internalSlug = slugger.slug(internalUrl)\n /**\n * @note(plaiceholder)\n *\n * Do not handle here.\n */\n // const { base64: internalBase64, img: internalImg } = await getPlaiceholder(\n // internalUrl\n // )\n _files[internalSlug] = {\n type: file?.type,\n url: getNotionHostedUrl(internalUrl, pageId),\n // base64: internalBase64,\n // img: internalImg,\n }\n }\n if (file?.type === 'external') {\n const externalUrl = file?.external?.url.split('?')[0]\n const externalSlug = slugger.slug(externalUrl)\n /**\n * @note(plaiceholder)\n *\n * Do not handle here.\n */\n // const { base64: externalBase64, img: externalImg } = await getPlaiceholder(\n // externalUrl\n // )\n _files[externalSlug] = {\n type: file?.type,\n url: externalUrl,\n // base64: externalBase64,\n // img: externalImg,\n }\n }\n // if (file?.type === 'image') {\n // const externalUrl = file?.external?.url.split('?')[0]\n // const externalSlug = slugger.slug(externalUrl)\n // _files[externalSlug] = { type: file?.type, url: externalUrl }\n // }\n\n // return\n },\n )\n\n return _files\n}\n\nexport default files\n"],"mappings":"iJAKA,MAEM,GAAsB,EAAgC,IAC1D,yFACG,QAAQ,eAAgB,mBAAmB,EAAI,CAAC,CAChD,QAAQ,cAAe,EAAa,EAAO,CAAC,CAE3C,GAAS,EAAW,IAAmB,CAC3C,IAAM,EAAU,IAAI,EACd,EAAS,EAAE,CAmDjB,OAjDIA,EAAM,EAAK,MAAM,EAAI,GACzB,EAAK,MAAM,IACR,GAA6E,CAC5E,GAAI,GAAM,OAAS,OAAQ,CACzB,IAAM,EAAc,GAAM,MAAM,IAAI,MAAM,IAAI,CAAC,GACzC,EAAe,EAAQ,KAAK,EAAY,CAS9C,EAAO,GAAgB,CACrB,KAAM,GAAM,KACZ,IAAK,EAAmB,EAAa,EAAO,CAG7C,CAEH,GAAI,GAAM,OAAS,WAAY,CAC7B,IAAM,EAAc,GAAM,UAAU,IAAI,MAAM,IAAI,CAAC,GAC7C,EAAe,EAAQ,KAAK,EAAY,CAS9C,EAAO,GAAgB,CACrB,KAAM,GAAM,KACZ,IAAK,EAGN,GAUN,CA/CkC"}
1
+ {"version":3,"file":"files.mjs","names":["_size"],"sources":["../../../src/utils/getTypes/files.ts"],"sourcesContent":["import { stringToUUID } from '@jeromefitz/utils'\n\nimport Slugger from 'github-slugger'\nimport { size as _size } from 'lodash-es'\n\nconst notionImageHosted = `https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600`\n\nconst getNotionHostedUrl = (url: boolean | number | string, pageId: string) =>\n notionImageHosted\n .replace('{{FILENAME}}', encodeURIComponent(url))\n .replace('{{PAGE_ID}}', stringToUUID(pageId))\n\nconst files = (data: any, pageId: string) => {\n const slugger = new Slugger()\n const _files = {}\n\n if (_size(data.files) <= 0) return _files\n data.files.map(\n (file: { external: { url: string }; file: { url: string }; type: string }) => {\n if (file?.type === 'file') {\n const internalUrl = file?.file?.url.split('?')[0]\n const internalSlug = slugger.slug(internalUrl)\n /**\n * @note(plaiceholder)\n *\n * Do not handle here.\n */\n // const { base64: internalBase64, img: internalImg } = await getPlaiceholder(\n // internalUrl\n // )\n _files[internalSlug] = {\n type: file?.type,\n url: getNotionHostedUrl(internalUrl, pageId),\n // base64: internalBase64,\n // img: internalImg,\n }\n }\n if (file?.type === 'external') {\n const externalUrl = file?.external?.url.split('?')[0]\n const externalSlug = slugger.slug(externalUrl)\n /**\n * @note(plaiceholder)\n *\n * Do not handle here.\n */\n // const { base64: externalBase64, img: externalImg } = await getPlaiceholder(\n // externalUrl\n // )\n _files[externalSlug] = {\n type: file?.type,\n url: externalUrl,\n // base64: externalBase64,\n // img: externalImg,\n }\n }\n // if (file?.type === 'image') {\n // const externalUrl = file?.external?.url.split('?')[0]\n // const externalSlug = slugger.slug(externalUrl)\n // _files[externalSlug] = { type: file?.type, url: externalUrl }\n // }\n\n // return\n },\n )\n\n return _files\n}\n\nexport default files\n"],"mappings":"gHAKA,MAEM,GAAsB,EAAgC,IAC1D,yFACG,QAAQ,eAAgB,mBAAmB,CAAG,CAAC,EAC/C,QAAQ,cAAe,EAAa,CAAM,CAAC,EAE1C,GAAS,EAAW,IAAmB,CAC3C,IAAM,EAAU,IAAI,EACd,EAAS,CAAC,EAmDhB,OAjDIA,EAAM,EAAK,KAAK,GAAK,GACzB,EAAK,MAAM,IACR,GAA6E,CAC5E,GAAI,GAAM,OAAS,OAAQ,CACzB,IAAM,EAAc,GAAM,MAAM,IAAI,MAAM,GAAG,EAAE,GACzC,EAAe,EAAQ,KAAK,CAAW,EAS7C,EAAO,GAAgB,CACrB,KAAM,GAAM,KACZ,IAAK,EAAmB,EAAa,CAAM,CAG7C,CACF,CACA,GAAI,GAAM,OAAS,WAAY,CAC7B,IAAM,EAAc,GAAM,UAAU,IAAI,MAAM,GAAG,EAAE,GAC7C,EAAe,EAAQ,KAAK,CAAW,EAS7C,EAAO,GAAgB,CACrB,KAAM,GAAM,KACZ,IAAK,CAGP,CACF,CAQF,CACF,EA/CmC,CAkDrC"}
@@ -1 +1 @@
1
- import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../getTypes-Df5GL8wS.mjs";export{e as default};
1
+ import{t as e}from"../../getTypes-D-cwjcBl.mjs";export{e as default};
@@ -1 +1 @@
1
- {"version":3,"file":"multi_select.d.mts","names":[],"sources":["../../../src/utils/getTypes/multi_select.ts"],"mappings":";cAGM,YAAA,GAAgB,IAAA"}
1
+ {"version":3,"file":"multi_select.d.mts","names":[],"sources":["../../../src/utils/getTypes/multi_select.ts"],"mappings":";cAGM,YAAA,GAAgB,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import{map as e}from"lodash-es";import t from"github-slugger";const n=n=>{let r=new t,i={};return e(n.multi_select,e=>{let t=e;t.slug=r.slug(t.name),i[t.id]=t}),i};export{n as default};
1
+ import{map as e}from"lodash-es";import t from"github-slugger";const n=n=>{let r=new t,i={};return e(n.multi_select,e=>{let t=e;t.slug=r.slug(t.name),i[t.id]=t}),i};export{n as default};
2
2
  //# sourceMappingURL=multi_select.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"multi_select.mjs","names":[],"sources":["../../../src/utils/getTypes/multi_select.ts"],"sourcesContent":["import Slugger from 'github-slugger'\nimport { map as _map } from 'lodash-es'\n\nconst multi_select = (data: any) => {\n const slugger = new Slugger()\n\n const dataReturn = {}\n _map(data.multi_select, (multiSelect: any) => {\n const ms = multiSelect\n ms.slug = slugger.slug(ms.name)\n dataReturn[ms.id] = ms\n })\n return dataReturn\n}\n\nexport default multi_select\n"],"mappings":"+FAGA,MAAM,EAAgB,GAAc,CAClC,IAAM,EAAU,IAAI,EAEd,EAAa,EAAE,CAMrB,OALA,EAAK,EAAK,aAAe,GAAqB,CAC5C,IAAM,EAAK,EACX,EAAG,KAAO,EAAQ,KAAK,EAAG,KAAK,CAC/B,EAAW,EAAG,IAAM,GACpB,CACK"}
1
+ {"version":3,"file":"multi_select.mjs","names":[],"sources":["../../../src/utils/getTypes/multi_select.ts"],"sourcesContent":["import Slugger from 'github-slugger'\nimport { map as _map } from 'lodash-es'\n\nconst multi_select = (data: any) => {\n const slugger = new Slugger()\n\n const dataReturn = {}\n _map(data.multi_select, (multiSelect: any) => {\n const ms = multiSelect\n ms.slug = slugger.slug(ms.name)\n dataReturn[ms.id] = ms\n })\n return dataReturn\n}\n\nexport default multi_select\n"],"mappings":"8DAGA,MAAM,EAAgB,GAAc,CAClC,IAAM,EAAU,IAAI,EAEd,EAAa,CAAC,EAMpB,OALA,EAAK,EAAK,aAAe,GAAqB,CAC5C,IAAM,EAAK,EACX,EAAG,KAAO,EAAQ,KAAK,EAAG,IAAI,EAC9B,EAAW,EAAG,IAAM,CACtB,CAAC,EACM,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.mts","names":[],"sources":["../../../src/utils/getTypes/number.ts"],"mappings":";cACM,MAAA,GAAU,IAAA"}
1
+ {"version":3,"file":"number.d.mts","names":[],"sources":["../../../src/utils/getTypes/number.ts"],"mappings":";cACM,MAAA,GAAU,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>e?.number||null;export{e as default};
1
+ const e=e=>e?.number||null;export{e as default};
2
2
  //# sourceMappingURL=number.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.mjs","names":[],"sources":["../../../src/utils/getTypes/number.ts"],"sourcesContent":["// @todo(notion) allow for format\nconst number = (data: any) => {\n return data?.number || null\n}\n\nexport default number\n"],"mappings":"iCACA,MAAM,EAAU,GACP,GAAM,QAAU"}
1
+ {"version":3,"file":"number.mjs","names":[],"sources":["../../../src/utils/getTypes/number.ts"],"sourcesContent":["// @todo(notion) allow for format\nconst number = (data: any) => {\n return data?.number || null\n}\n\nexport default number\n"],"mappings":"AACA,MAAM,EAAU,GACP,GAAM,QAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"people.d.mts","names":[],"sources":["../../../src/utils/getTypes/people.ts"],"mappings":";cAEM,MAAA,GAAU,IAAA"}
1
+ {"version":3,"file":"people.d.mts","names":[],"sources":["../../../src/utils/getTypes/people.ts"],"mappings":";cAEM,MAAA,GAAU,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";import e from"github-slugger";const t=t=>{let n=new e;return t.people.map(e=>{let{avatar_url:t,id:r,name:i,person:a}=e,{email:o}=a;return{[n.slug(i)]:{avatar_url:t,email:o,id:r,name:i}}})[0]};export{t as default};
1
+ import e from"github-slugger";const t=t=>{let n=new e;return t.people.map(e=>{let{avatar_url:t,id:r,name:i,person:a}=e,{email:o}=a;return{[n.slug(i)]:{avatar_url:t,email:o,id:r,name:i}}})[0]};export{t as default};
2
2
  //# sourceMappingURL=people.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"people.mjs","names":[],"sources":["../../../src/utils/getTypes/people.ts"],"sourcesContent":["import Slugger from 'github-slugger'\n\nconst people = (data: any) => {\n const slugger = new Slugger()\n return data.people.map((p) => {\n const { avatar_url, id, name, person } = p\n const { email } = person\n const slug = slugger.slug(name)\n\n return {\n [slug]: {\n avatar_url,\n email,\n id,\n name,\n },\n }\n })[0]\n // return data.people || null\n}\n\nexport default people\n"],"mappings":"+DAEA,MAAM,EAAU,GAAc,CAC5B,IAAM,EAAU,IAAI,EACpB,OAAO,EAAK,OAAO,IAAK,GAAM,CAC5B,GAAM,CAAE,aAAY,KAAI,OAAM,UAAW,EACnC,CAAE,SAAU,EAGlB,MAAO,EAFM,EAAQ,KAAK,EAAK,EAGrB,CACN,aACA,QACA,KACA,OACD,CACF,EACD,CAAC"}
1
+ {"version":3,"file":"people.mjs","names":[],"sources":["../../../src/utils/getTypes/people.ts"],"sourcesContent":["import Slugger from 'github-slugger'\n\nconst people = (data: any) => {\n const slugger = new Slugger()\n return data.people.map((p) => {\n const { avatar_url, id, name, person } = p\n const { email } = person\n const slug = slugger.slug(name)\n\n return {\n [slug]: {\n avatar_url,\n email,\n id,\n name,\n },\n }\n })[0]\n // return data.people || null\n}\n\nexport default people\n"],"mappings":"8BAEA,MAAM,EAAU,GAAc,CAC5B,IAAM,EAAU,IAAI,EACpB,OAAO,EAAK,OAAO,IAAK,GAAM,CAC5B,GAAM,CAAE,aAAY,KAAI,OAAM,UAAW,EACnC,CAAE,SAAU,EAGlB,MAAO,EAFM,EAAQ,KAAK,CAGvB,GAAO,CACN,aACA,QACA,KACA,MACF,CACF,CACF,CAAC,EAAE,EAEL"}
@@ -1 +1 @@
1
- {"version":3,"file":"phone_number.d.mts","names":[],"sources":["../../../src/utils/getTypes/phone_number.ts"],"mappings":";cAAM,YAAA,GAAgB,IAAA"}
1
+ {"version":3,"file":"phone_number.d.mts","names":[],"sources":["../../../src/utils/getTypes/phone_number.ts"],"mappings":";cAAM,YAAA,GAAgB,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>e?.phone_number||null;export{e as default};
1
+ const e=e=>e?.phone_number||null;export{e as default};
2
2
  //# sourceMappingURL=phone_number.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone_number.mjs","names":[],"sources":["../../../src/utils/getTypes/phone_number.ts"],"sourcesContent":["const phone_number = (data: any) => data?.phone_number || null\n\nexport default phone_number\n"],"mappings":"iCAAA,MAAM,EAAgB,GAAc,GAAM,cAAgB"}
1
+ {"version":3,"file":"phone_number.mjs","names":[],"sources":["../../../src/utils/getTypes/phone_number.ts"],"sourcesContent":["const phone_number = (data: any) => data?.phone_number || null\n\nexport default phone_number\n"],"mappings":"AAAA,MAAM,EAAgB,GAAc,GAAM,cAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"relation.d.mts","names":[],"sources":["../../../src/utils/getTypes/relation.ts"],"mappings":";cAIM,QAAA,GAAY,IAAA"}
1
+ {"version":3,"file":"relation.d.mts","names":[],"sources":["../../../src/utils/getTypes/relation.ts"],"mappings":";cAIM,QAAA,GAAY,IAAS"}
@@ -1 +1 @@
1
- import"../../chunk-pm2C21R4.mjs";import{r as e}from"../../getTypes-Df5GL8wS.mjs";export{e as default};
1
+ import{r as e}from"../../getTypes-D-cwjcBl.mjs";export{e as default};
@@ -1 +1 @@
1
- {"version":3,"file":"rich_text.d.mts","names":[],"sources":["../../../src/utils/getTypes/rich_text.ts"],"mappings":";cAAM,SAAA,GAAa,IAAA"}
1
+ {"version":3,"file":"rich_text.d.mts","names":[],"sources":["../../../src/utils/getTypes/rich_text.ts"],"mappings":";cAAM,SAAA,GAAa,IAAS"}
@@ -1,2 +1,2 @@
1
- import"../../chunk-pm2C21R4.mjs";const e=e=>e?.rich_text?e?.rich_text[0]?.plain_text:null;export{e as default};
1
+ const e=e=>e?.rich_text?e?.rich_text[0]?.plain_text:null;export{e as default};
2
2
  //# sourceMappingURL=rich_text.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich_text.mjs","names":[],"sources":["../../../src/utils/getTypes/rich_text.ts"],"sourcesContent":["const rich_text = (data: any) =>\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n !!data?.rich_text ? data?.rich_text[0]?.plain_text : null\n\nexport default rich_text\n"],"mappings":"iCAAA,MAAM,EAAa,GAEf,GAAM,UAAY,GAAM,UAAU,IAAI,WAAa"}
1
+ {"version":3,"file":"rich_text.mjs","names":[],"sources":["../../../src/utils/getTypes/rich_text.ts"],"sourcesContent":["const rich_text = (data: any) =>\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n !!data?.rich_text ? data?.rich_text[0]?.plain_text : null\n\nexport default rich_text\n"],"mappings":"AAAA,MAAM,EAAa,GAEf,GAAM,UAAY,GAAM,UAAU,IAAI,WAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.d.mts","names":[],"sources":["../../../src/utils/getTypes/rollup.ts"],"mappings":";cAiBM,MAAA,GAAU,IAAA"}
1
+ {"version":3,"file":"rollup.d.mts","names":[],"sources":["../../../src/utils/getTypes/rollup.ts"],"mappings":";cAiBM,MAAA,GAAU,IAAS"}
@@ -1 +1 @@
1
- import"../../chunk-pm2C21R4.mjs";import{n as e}from"../../getTypes-Df5GL8wS.mjs";export{e as default};
1
+ import{n as e}from"../../getTypes-D-cwjcBl.mjs";export{e as default};