@jeromefitz/notion 5.1.12 → 5.1.13-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/chunk-pm2C21R4.mjs +1 -0
- package/constants/index.d.mts +129 -0
- package/constants/index.d.mts.map +1 -0
- package/constants/index.mjs +2 -0
- package/constants/index.mjs.map +1 -0
- package/getTypes-C_NXtnf-.mjs +2 -0
- package/getTypes-C_NXtnf-.mjs.map +1 -0
- package/index-CvmUSReI.d.mts +245 -0
- package/index-CvmUSReI.d.mts.map +1 -0
- package/index.d.mts +119 -0
- package/index.d.mts.map +1 -0
- package/index.mjs +2 -0
- package/index.mjs.map +1 -0
- package/package.json +52 -14
- package/queries/getBlocksByIdChildren/index.d.mts +11 -0
- package/queries/getBlocksByIdChildren/index.d.mts.map +1 -0
- package/queries/getBlocksByIdChildren/index.mjs +2 -0
- package/queries/getBlocksByIdChildren/index.mjs.map +1 -0
- package/queries/getDatabasesByIdQuery/index.d.mts +17 -0
- package/queries/getDatabasesByIdQuery/index.d.mts.map +1 -0
- package/queries/getDatabasesByIdQuery/index.mjs +2 -0
- package/queries/getDatabasesByIdQuery/index.mjs.map +1 -0
- package/queries/getDeepFetchAllChildren/index.d.mts +11 -0
- package/queries/getDeepFetchAllChildren/index.d.mts.map +1 -0
- package/queries/getDeepFetchAllChildren/index.mjs +2 -0
- package/queries/getDeepFetchAllChildren/index.mjs.map +1 -0
- package/queries/getInfoType/index.d.mts +22 -0
- package/queries/getInfoType/index.d.mts.map +1 -0
- package/queries/getInfoType/index.mjs +2 -0
- package/queries/getInfoType/index.mjs.map +1 -0
- package/queries/getNotionListing/index.d.mts +29 -0
- package/queries/getNotionListing/index.d.mts.map +1 -0
- package/queries/getNotionListing/index.mjs +2 -0
- package/queries/getNotionListing/index.mjs.map +1 -0
- package/queries/getNotionListingByDate/index.d.mts +26 -0
- package/queries/getNotionListingByDate/index.d.mts.map +1 -0
- package/queries/getNotionListingByDate/index.mjs +2 -0
- package/queries/getNotionListingByDate/index.mjs.map +1 -0
- package/queries/getNotionSlug/index.d.mts +36 -0
- package/queries/getNotionSlug/index.d.mts.map +1 -0
- package/queries/getNotionSlug/index.mjs +2 -0
- package/queries/getNotionSlug/index.mjs.map +1 -0
- package/queries/getNotionSlugByRoute/index.d.mts +26 -0
- package/queries/getNotionSlugByRoute/index.d.mts.map +1 -0
- package/queries/getNotionSlugByRoute/index.mjs +2 -0
- package/queries/getNotionSlugByRoute/index.mjs.map +1 -0
- package/queries/getPagesById/index.d.mts +11 -0
- package/queries/getPagesById/index.d.mts.map +1 -0
- package/queries/getPagesById/index.mjs +2 -0
- package/queries/getPagesById/index.mjs.map +1 -0
- package/queries/getPathVariables/index.d.mts +22 -0
- package/queries/getPathVariables/index.d.mts.map +1 -0
- package/queries/getPathVariables/index.mjs +2 -0
- package/queries/getPathVariables/index.mjs.map +1 -0
- package/queries/getQuery/index.d.mts +13 -0
- package/queries/getQuery/index.d.mts.map +1 -0
- package/queries/getQuery/index.mjs +2 -0
- package/queries/getQuery/index.mjs.map +1 -0
- package/queries/index.d.mts +12 -0
- package/queries/index.mjs +1 -0
- package/schema/index.d.mts +2 -0
- package/schema/index.mjs +1 -0
- package/utils/addTime/index.d.mts +5 -0
- package/utils/addTime/index.d.mts.map +1 -0
- package/utils/addTime/index.mjs +2 -0
- package/utils/addTime/index.mjs.map +1 -0
- package/utils/dataNormalized/index.d.mts +20 -0
- package/utils/dataNormalized/index.d.mts.map +1 -0
- package/utils/dataNormalized/index.mjs +1 -0
- package/utils/dataNormalizedResults/index.d.mts +19 -0
- package/utils/dataNormalizedResults/index.d.mts.map +1 -0
- package/utils/dataNormalizedResults/index.mjs +1 -0
- package/utils/getDataType/{index.d.ts → index.d.mts} +12 -6
- package/utils/getDataType/index.d.mts.map +1 -0
- package/utils/getDataType/index.mjs +2 -0
- package/utils/getDataType/index.mjs.map +1 -0
- package/utils/getTitle/{index.d.ts → index.d.mts} +3 -1
- package/utils/getTitle/index.d.mts.map +1 -0
- package/utils/getTitle/index.mjs +2 -0
- package/utils/getTitle/index.mjs.map +1 -0
- package/utils/getTypes/_unsupported.d.mts +6 -0
- package/utils/getTypes/_unsupported.d.mts.map +1 -0
- package/utils/getTypes/_unsupported.mjs +2 -0
- package/utils/getTypes/_unsupported.mjs.map +1 -0
- package/utils/getTypes/checkbox.d.mts +5 -0
- package/utils/getTypes/checkbox.d.mts.map +1 -0
- package/utils/getTypes/checkbox.mjs +2 -0
- package/utils/getTypes/checkbox.mjs.map +1 -0
- package/utils/getTypes/date.d.mts +5 -0
- package/utils/getTypes/date.d.mts.map +1 -0
- package/utils/getTypes/date.mjs +2 -0
- package/utils/getTypes/date.mjs.map +1 -0
- package/utils/getTypes/email.d.mts +5 -0
- package/utils/getTypes/email.d.mts.map +1 -0
- package/utils/getTypes/email.mjs +2 -0
- package/utils/getTypes/email.mjs.map +1 -0
- package/utils/getTypes/files.d.mts +5 -0
- package/utils/getTypes/files.d.mts.map +1 -0
- package/utils/getTypes/files.mjs +2 -0
- package/utils/getTypes/files.mjs.map +1 -0
- package/utils/getTypes/index.d.mts +28 -0
- package/utils/getTypes/index.d.mts.map +1 -0
- package/utils/getTypes/index.mjs +1 -0
- package/utils/getTypes/multi_select.d.mts +5 -0
- package/utils/getTypes/multi_select.d.mts.map +1 -0
- package/utils/getTypes/multi_select.mjs +2 -0
- package/utils/getTypes/multi_select.mjs.map +1 -0
- package/utils/getTypes/number.d.mts +5 -0
- package/utils/getTypes/number.d.mts.map +1 -0
- package/utils/getTypes/number.mjs +2 -0
- package/utils/getTypes/number.mjs.map +1 -0
- package/utils/getTypes/people.d.mts +5 -0
- package/utils/getTypes/people.d.mts.map +1 -0
- package/utils/getTypes/people.mjs +2 -0
- package/utils/getTypes/people.mjs.map +1 -0
- package/utils/getTypes/phone_number.d.mts +5 -0
- package/utils/getTypes/phone_number.d.mts.map +1 -0
- package/utils/getTypes/phone_number.mjs +2 -0
- package/utils/getTypes/phone_number.mjs.map +1 -0
- package/utils/getTypes/relation.d.mts +5 -0
- package/utils/getTypes/relation.d.mts.map +1 -0
- package/utils/getTypes/relation.mjs +1 -0
- package/utils/getTypes/rich_text.d.mts +5 -0
- package/utils/getTypes/rich_text.d.mts.map +1 -0
- package/utils/getTypes/rich_text.mjs +2 -0
- package/utils/getTypes/rich_text.mjs.map +1 -0
- package/utils/getTypes/rollup.d.mts +5 -0
- package/utils/getTypes/rollup.d.mts.map +1 -0
- package/utils/getTypes/rollup.mjs +1 -0
- package/utils/getTypes/select.d.mts +7 -0
- package/utils/getTypes/select.d.mts.map +1 -0
- package/utils/getTypes/select.mjs +2 -0
- package/utils/getTypes/select.mjs.map +1 -0
- package/utils/getTypes/title.d.mts +5 -0
- package/utils/getTypes/title.d.mts.map +1 -0
- package/utils/getTypes/title.mjs +2 -0
- package/utils/getTypes/title.mjs.map +1 -0
- package/utils/getTypes/url.d.mts +5 -0
- package/utils/getTypes/url.d.mts.map +1 -0
- package/utils/getTypes/url.mjs +2 -0
- package/utils/getTypes/url.mjs.map +1 -0
- package/utils/index.d.mts +7 -0
- package/utils/index.mjs +1 -0
- package/utils-CyUrB6XV.mjs +2 -0
- package/utils-CyUrB6XV.mjs.map +1 -0
- package/constants/index.d.ts +0 -127
- package/constants/index.js +0 -1
- package/index.d.ts +0 -117
- package/index.js +0 -1
- package/queries/getBlocksByIdChildren/index.d.ts +0 -6
- package/queries/getBlocksByIdChildren/index.js +0 -1
- package/queries/getDatabasesByIdQuery/index.d.ts +0 -10
- package/queries/getDatabasesByIdQuery/index.js +0 -1
- package/queries/getDeepFetchAllChildren/index.d.ts +0 -6
- package/queries/getDeepFetchAllChildren/index.js +0 -1
- package/queries/getInfoType/index.d.ts +0 -13
- package/queries/getInfoType/index.js +0 -1
- package/queries/getNotionListing/index.d.ts +0 -20
- package/queries/getNotionListing/index.js +0 -1
- package/queries/getNotionListingByDate/index.d.ts +0 -16
- package/queries/getNotionListingByDate/index.js +0 -1
- package/queries/getNotionSlug/index.d.ts +0 -26
- package/queries/getNotionSlug/index.js +0 -1
- package/queries/getNotionSlugByRoute/index.d.ts +0 -16
- package/queries/getNotionSlugByRoute/index.js +0 -1
- package/queries/getPagesById/index.d.ts +0 -6
- package/queries/getPagesById/index.js +0 -1
- package/queries/getPathVariables/index.d.ts +0 -17
- package/queries/getPathVariables/index.js +0 -1
- package/queries/getQuery/index.d.ts +0 -7
- package/queries/getQuery/index.js +0 -1
- package/queries/index.d.ts +0 -12
- package/queries/index.js +0 -1
- package/schema/index.d.ts +0 -243
- package/schema/index.js +0 -0
- package/utils/addTime/index.d.ts +0 -3
- package/utils/addTime/index.js +0 -1
- package/utils/dataNormalized/index.d.ts +0 -13
- package/utils/dataNormalized/index.js +0 -1
- package/utils/dataNormalizedResults/index.d.ts +0 -13
- package/utils/dataNormalizedResults/index.js +0 -1
- package/utils/getDataType/index.js +0 -1
- package/utils/getTitle/index.js +0 -1
- package/utils/getTypes/_unsupported.d.ts +0 -3
- package/utils/getTypes/_unsupported.js +0 -1
- package/utils/getTypes/checkbox.d.ts +0 -3
- package/utils/getTypes/checkbox.js +0 -1
- package/utils/getTypes/date.d.ts +0 -3
- package/utils/getTypes/date.js +0 -1
- package/utils/getTypes/email.d.ts +0 -3
- package/utils/getTypes/email.js +0 -1
- package/utils/getTypes/files.d.ts +0 -3
- package/utils/getTypes/files.js +0 -1
- package/utils/getTypes/index.d.ts +0 -26
- package/utils/getTypes/index.js +0 -1
- package/utils/getTypes/multi_select.d.ts +0 -3
- package/utils/getTypes/multi_select.js +0 -1
- package/utils/getTypes/number.d.ts +0 -3
- package/utils/getTypes/number.js +0 -1
- package/utils/getTypes/people.d.ts +0 -3
- package/utils/getTypes/people.js +0 -1
- package/utils/getTypes/phone_number.d.ts +0 -3
- package/utils/getTypes/phone_number.js +0 -1
- package/utils/getTypes/relation.d.ts +0 -3
- package/utils/getTypes/relation.js +0 -1
- package/utils/getTypes/rich_text.d.ts +0 -3
- package/utils/getTypes/rich_text.js +0 -1
- package/utils/getTypes/rollup.d.ts +0 -3
- package/utils/getTypes/rollup.js +0 -1
- package/utils/getTypes/select.d.ts +0 -5
- package/utils/getTypes/select.js +0 -1
- package/utils/getTypes/title.d.ts +0 -3
- package/utils/getTypes/title.js +0 -1
- package/utils/getTypes/url.d.ts +0 -3
- package/utils/getTypes/url.js +0 -1
- package/utils/index.d.ts +0 -7
- package/utils/index.js +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { r as DataTypes } from "../../index-CvmUSReI.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/queries/getPathVariables/index.d.ts
|
|
4
|
+
declare const getPathVariables: ({
|
|
5
|
+
catchAll,
|
|
6
|
+
config
|
|
7
|
+
}: {
|
|
8
|
+
catchAll: any;
|
|
9
|
+
config: any;
|
|
10
|
+
}) => {
|
|
11
|
+
dataType: DataTypes;
|
|
12
|
+
hasMeta: boolean;
|
|
13
|
+
isIndex: boolean;
|
|
14
|
+
isPage: boolean;
|
|
15
|
+
meta: unknown[];
|
|
16
|
+
routeType: any;
|
|
17
|
+
slug: any;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getPathVariables as default };
|
|
22
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getPathVariables/index.ts"],"mappings":";;;cAeM,gBAAA;EAAoB,QAAA;EAAA;AAAA;;;;YAAA,SAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import"../../utils-CyUrB6XV.mjs";import e from"../../utils/getDataType/index.mjs";import"../../getTypes-C_NXtnf-.mjs";import t from"lodash/last.js";import n from"lodash/size.js";import r from"lodash/drop.js";import i from"lodash/dropRight.js";import a from"lodash/first.js";import o from"lodash/includes.js";import s from"lodash/isInteger.js";import c from"lodash/join.js";const l=({catchAll:l,config:u})=>{let{NOTION:d,PAGES__HOMEPAGE:f,ROUTE_META:p,ROUTE_TYPES:m}=u,h=n(l),g=a(l),_=g.toUpperCase(),v=t(l),y=h>1&&o(p,_)?r(l):r(i(l)),b=g===v&&!o(m,_)?d.PAGES.routeType:g,x=g!==v&&!s(parseInt(v))?v:g,S=b===d.PAGES.routeType.toLowerCase(),C=x===g,w={hasMeta:!!y&&n(y)!==0,isIndex:C,isPage:S,meta:y,routeType:b,slug:x,url:S&&g===f?``:c(l,`/`)},T=e(w);return{...w,dataType:T}};export{l as default};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getPathVariables/index.ts"],"sourcesContent":["/**\n * @refactor(lodash)\n */\nimport _drop from 'lodash/drop.js'\nimport _dropRight from 'lodash/dropRight.js'\nimport _first from 'lodash/first.js'\nimport _includes from 'lodash/includes.js'\nimport _isInteger from 'lodash/isInteger.js'\nimport _join from 'lodash/join.js'\nimport _last from 'lodash/last.js'\nimport _size from 'lodash/size.js'\n\n// import { DATA_TYPES } from '../../constants/index.js'\nimport { getDataType } from '../../utils/index.js'\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":"sZAeA,MAAM,GAAoB,CAAE,WAAU,YAAa,CACjD,GAAM,CAAE,SAAQ,kBAAiB,aAAY,eAAgB,EACvD,EAAe,EAAM,EAAS,CAC9B,EAAa,EAAO,EAAS,CAC7B,EAAQ,EAAM,aAAa,CAC3B,EAAY,EAAM,EAAS,CAG3B,EACJ,EAAO,GAAK,EAAU,EAAY,EAAM,CACpC,EAAM,EAAS,CACf,EAAM,EAAW,EAAS,CAAC,CAE3B,EACJ,IAAU,GAAQ,CAAC,EAAU,EAAa,EAAM,CAAG,EAAO,MAAM,UAAY,EAExE,EAAO,IAAU,GAAQ,CAAC,EAAW,SAAS,EAAK,CAAC,CAAG,EAAO,EAE9D,EAAS,IAAc,EAAO,MAAM,UAAU,aAAa,CAC3D,EAAU,IAAS,EAKnB,EAAgB,CACpB,QALc,CAAC,CAAC,GAAQ,EAAM,EAAK,GAAK,EAMxC,UACA,SACA,OACA,YACA,OACA,IATU,GAAU,IAAU,EAAkB,GAAK,EAAM,EAAU,IAAI,CAU1E,CAKK,EAAW,EAAY,EAAc,CAE3C,MAAO,CACL,GAAG,EACH,WACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/queries/getQuery/index.d.ts
|
|
2
|
+
declare const getQuery: ({
|
|
3
|
+
config,
|
|
4
|
+
notionDatabasesQuery,
|
|
5
|
+
reqQuery
|
|
6
|
+
}: {
|
|
7
|
+
config: any;
|
|
8
|
+
notionDatabasesQuery: any;
|
|
9
|
+
reqQuery: any;
|
|
10
|
+
}) => Promise<any>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getQuery as default };
|
|
13
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getQuery/index.ts"],"mappings":";cAuBM,QAAA;EAAkB,MAAA;EAAA,oBAAA;EAAA;AAAA;;;;MAA0C,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{PROPERTIES as e}from"../../constants/index.mjs";import{t}from"../../utils-CyUrB6XV.mjs";import"../../getTypes-C_NXtnf-.mjs";import n from"lodash/map.js";import{avoidRateLimit as r,isObjectEmpty as i}from"@jeromefitz/utils";import a from"lodash/omit.js";import o from"lodash/size.js";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=[],i=[];t&&i.push(...t?.split(`,`)),o(i)>0&&n(i,t=>r.push({property:e.relationEpisodes__Podcasts.notion,relation:{contains:t}})),v={or:[...r]}}else m=!0;if(!m&&(!g||i(g))){await r(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=a(g,`results`),g.results=_):m=!0}return g};export{c as default};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getQuery/index.ts"],"sourcesContent":["import type { SortItem } from '../../schema/index.js'\n\nimport { avoidRateLimit, isObjectEmpty } from '@jeromefitz/utils'\n\nimport _map from 'lodash/map.js'\nimport _omit from 'lodash/omit.js'\nimport _size from 'lodash/size.js'\n\nimport { PROPERTIES } from '../../constants/index.js'\nimport dataNormalizedResults from '../../utils/dataNormalizedResults/index.js'\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":"mUAcA,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,GAClB,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,EAAO,EAAM,EAAM,UAAU,CAC7B,EAAK,QAAU,GAGf,EAAW,GAiBf,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import getBlocksByIdChildren from "./getBlocksByIdChildren/index.mjs";
|
|
2
|
+
import getDatabasesByIdQuery from "./getDatabasesByIdQuery/index.mjs";
|
|
3
|
+
import getDeepFetchAllChildren from "./getDeepFetchAllChildren/index.mjs";
|
|
4
|
+
import getInfoType from "./getInfoType/index.mjs";
|
|
5
|
+
import getNotionListing from "./getNotionListing/index.mjs";
|
|
6
|
+
import getNotionListingByDate from "./getNotionListingByDate/index.mjs";
|
|
7
|
+
import getNotionSlug from "./getNotionSlug/index.mjs";
|
|
8
|
+
import getNotionSlugByRoute from "./getNotionSlugByRoute/index.mjs";
|
|
9
|
+
import getPagesById from "./getPagesById/index.mjs";
|
|
10
|
+
import getPathVariables from "./getPathVariables/index.mjs";
|
|
11
|
+
import getQuery from "./getQuery/index.mjs";
|
|
12
|
+
export { getBlocksByIdChildren, getDatabasesByIdQuery, getDeepFetchAllChildren, getInfoType, getNotionListing, getNotionListingByDate, getNotionSlug, getNotionSlugByRoute, getPagesById, getPathVariables, getQuery };
|
|
@@ -0,0 +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-CyUrB6XV.mjs";import"../getTypes-C_NXtnf-.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};
|
|
@@ -0,0 +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 };
|
package/schema/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunk-pm2C21R4.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/addTime/index.ts"],"mappings":";cAMM,OAAA,GAAW,IAAA,OAAM,IAAA"}
|
|
@@ -0,0 +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};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/utils/dataNormalized/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @todo(notion)
|
|
4
|
+
*
|
|
5
|
+
* Refactor to remove `config` as a parameter, or move this to `queries`
|
|
6
|
+
*/
|
|
7
|
+
declare const dataNormalized: ({
|
|
8
|
+
config,
|
|
9
|
+
data,
|
|
10
|
+
pageId,
|
|
11
|
+
pathVariables
|
|
12
|
+
}: {
|
|
13
|
+
config: any;
|
|
14
|
+
data: any;
|
|
15
|
+
pageId: any;
|
|
16
|
+
pathVariables: any;
|
|
17
|
+
}) => {};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { dataNormalized as default };
|
|
20
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/dataNormalized/index.ts"],"mappings":";;;;;;cAUM,cAAA;EAAkB,MAAA;EAAA,IAAA;EAAA,MAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{n as e}from"../../utils-CyUrB6XV.mjs";import"../../getTypes-C_NXtnf-.mjs";export{e as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/utils/dataNormalizedResults/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @todo(notion)
|
|
4
|
+
*
|
|
5
|
+
* Refactor after `dataNormalized` to remove `config` as a parameter,
|
|
6
|
+
* or move this to `queries`
|
|
7
|
+
*/
|
|
8
|
+
declare const dataNormalizedResults: ({
|
|
9
|
+
config,
|
|
10
|
+
results,
|
|
11
|
+
routeType
|
|
12
|
+
}: {
|
|
13
|
+
config: any;
|
|
14
|
+
results: any;
|
|
15
|
+
routeType: any;
|
|
16
|
+
}) => any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { dataNormalizedResults as default };
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/dataNormalizedResults/index.ts"],"mappings":";;;;;;;cAaM,qBAAA;EAAyB,MAAA;EAAA,OAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../utils-CyUrB6XV.mjs";import"../../getTypes-C_NXtnf-.mjs";export{e as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DataTypes } from
|
|
1
|
+
import { r as DataTypes } from "../../index-CvmUSReI.mjs";
|
|
2
2
|
|
|
3
|
+
//#region src/utils/getDataType/index.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* @info dataType
|
|
5
6
|
* pathVariables via `../../queries/pathVariables`
|
|
@@ -51,10 +52,15 @@ import { DataTypes } from '../../schema/index.js';
|
|
|
51
52
|
* /podcasts/[slug]
|
|
52
53
|
*
|
|
53
54
|
*/
|
|
54
|
-
declare const getDataType: ({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
declare const getDataType: ({
|
|
56
|
+
hasMeta,
|
|
57
|
+
isIndex,
|
|
58
|
+
isPage
|
|
59
|
+
}: {
|
|
60
|
+
hasMeta: any;
|
|
61
|
+
isIndex: any;
|
|
62
|
+
isPage: any;
|
|
58
63
|
}) => DataTypes;
|
|
59
|
-
|
|
64
|
+
//#endregion
|
|
60
65
|
export { getDataType as default };
|
|
66
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/getDataType/index.ts"],"sourcesContent":["import { DATA_TYPES } from '../../constants/index.js'\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,7 +1,9 @@
|
|
|
1
|
+
//#region src/utils/getTitle/index.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* @note this should be in the website repo as it’s custom
|
|
3
4
|
* *cough* more custom than _waves vaguely all-around_ all of this
|
|
4
5
|
*/
|
|
5
6
|
declare const getTitle: (title: string) => string;
|
|
6
|
-
|
|
7
|
+
//#endregion
|
|
7
8
|
export { getTitle as default };
|
|
9
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/getTitle/index.ts"],"mappings":";;;;;cAMM,QAAA,GAAY,KAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import e from"lodash/last.js";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
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/getTitle/index.ts"],"sourcesContent":["import _last from 'lodash/last.js'\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":"+DAMA,MAAM,EAAY,GAAkB,CAClC,IAAM,EAAiB,EAAM,EAAM,MAAM,IAAI,CAAC,EAAI,GAUlD,OAPM,GACG,EACJ,QAAQ,OAAQ,gBAAgB,CAChC,QAAQ,UAAW,mBAAmB,CACtC,QAAQ,YAAa,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_unsupported.d.mts","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"mappings":";;cACM,YAAA,GAAgB,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.mts","names":[],"sources":["../../../src/utils/getTypes/checkbox.ts"],"mappings":";cAAM,QAAA,GAAY,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.mts","names":[],"sources":["../../../src/utils/getTypes/date.ts"],"mappings":";cAAM,IAAA,GAAQ,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.mts","names":[],"sources":["../../../src/utils/getTypes/email.ts"],"mappings":";cAAM,KAAA,GAAS,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.mts","names":[],"sources":["../../../src/utils/getTypes/files.ts"],"mappings":";cAYM,KAAA,GAAS,IAAA,OAAW,MAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{stringToUUID as e}from"@jeromefitz/utils";import t from"github-slugger";import n from"lodash/size.js";const r=(t,n)=>`https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600`.replace(`{{FILENAME}}`,encodeURIComponent(t)).replace(`{{PAGE_ID}}`,e(n)),i=(e,i)=>{let a=new t,o={};return n(e.files)<=0||e.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
|
+
//# sourceMappingURL=files.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.mjs","names":[],"sources":["../../../src/utils/getTypes/files.ts"],"sourcesContent":["import { stringToUUID } from '@jeromefitz/utils'\n\nimport Slugger from 'github-slugger'\nimport _size from 'lodash/size.js'\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":"8IAKA,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,OAjDI,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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/utils/getTypes/index.d.ts
|
|
2
|
+
declare const getTypes: {
|
|
3
|
+
checkbox: (data: any) => any;
|
|
4
|
+
created_by: (data: any) => any;
|
|
5
|
+
created_time: (data: any) => any;
|
|
6
|
+
date: (data: any) => any;
|
|
7
|
+
email: (data: any) => any;
|
|
8
|
+
files: (data: any, pageId: string) => {};
|
|
9
|
+
formula: (data: any) => any;
|
|
10
|
+
image: (data: any, pageId: string) => {};
|
|
11
|
+
last_edited_by: (data: any) => any;
|
|
12
|
+
last_edited_time: (data: any) => any;
|
|
13
|
+
multi_select: (data: any) => {};
|
|
14
|
+
number: (data: any) => any;
|
|
15
|
+
people: (data: any) => any;
|
|
16
|
+
phone_number: (data: any) => any;
|
|
17
|
+
relation: (data: any) => any;
|
|
18
|
+
rich_text: (data: any) => any;
|
|
19
|
+
rollup: (data: any) => any[];
|
|
20
|
+
select: (data: any) => {
|
|
21
|
+
[x: number]: any;
|
|
22
|
+
} | null;
|
|
23
|
+
title: (data: any) => any;
|
|
24
|
+
url: (data: any) => any;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getTypes as default };
|
|
28
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/getTypes/index.ts"],"mappings":";cAiBM,QAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{t as e}from"../../getTypes-C_NXtnf-.mjs";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi_select.d.mts","names":[],"sources":["../../../src/utils/getTypes/multi_select.ts"],"mappings":";cAGM,YAAA,GAAgB,IAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi_select.mjs","names":[],"sources":["../../../src/utils/getTypes/multi_select.ts"],"sourcesContent":["import Slugger from 'github-slugger'\nimport _map from 'lodash/map.js'\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":"4FAGA,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.mts","names":[],"sources":["../../../src/utils/getTypes/number.ts"],"mappings":";cACM,MAAA,GAAU,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"people.d.mts","names":[],"sources":["../../../src/utils/getTypes/people.ts"],"mappings":";cAEM,MAAA,GAAU,IAAA"}
|
|
@@ -0,0 +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};
|
|
2
|
+
//# sourceMappingURL=people.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone_number.d.mts","names":[],"sources":["../../../src/utils/getTypes/phone_number.ts"],"mappings":";cAAM,YAAA,GAAgB,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation.d.mts","names":[],"sources":["../../../src/utils/getTypes/relation.ts"],"mappings":";cAIM,QAAA,GAAY,IAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{r as e}from"../../getTypes-C_NXtnf-.mjs";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich_text.d.mts","names":[],"sources":["../../../src/utils/getTypes/rich_text.ts"],"mappings":";cAAM,SAAA,GAAa,IAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollup.d.mts","names":[],"sources":["../../../src/utils/getTypes/rollup.ts"],"mappings":";cAkBM,MAAA,GAAU,IAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-pm2C21R4.mjs";import{n as e}from"../../getTypes-C_NXtnf-.mjs";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.mts","names":[],"sources":["../../../src/utils/getTypes/select.ts"],"mappings":";cAEM,MAAA,GAAU,IAAA;EAAA,CAAA,CAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.mjs","names":[],"sources":["../../../src/utils/getTypes/select.ts"],"sourcesContent":["import Slugger from 'github-slugger'\n\nconst select = (data: any) => {\n const slugger = new Slugger()\n\n const s: any = data.select\n // console.dir(`getTypeSelectNormalized`)\n // console.dir(data)\n\n // biome-ignore lint/complexity/noExtraBooleanCast: migrate\n if (!!s) {\n s.slug = slugger.slug(data.select.name)\n return { [s.id]: s }\n } else {\n return null\n }\n\n // return data\n}\n\nexport default select\n"],"mappings":"+DAEA,MAAM,EAAU,GAAc,CAC5B,IAAM,EAAU,IAAI,EAEd,EAAS,EAAK,OASlB,OAJI,GACJ,EAAE,KAAO,EAAQ,KAAK,EAAK,OAAO,KAAK,CAChC,EAAG,EAAE,IAAK,EAAG,EAEb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.d.mts","names":[],"sources":["../../../src/utils/getTypes/title.ts"],"mappings":";cACM,KAAA,GAAS,IAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.mjs","names":[],"sources":["../../../src/utils/getTypes/title.ts"],"sourcesContent":["// biome-ignore lint/complexity/noExtraBooleanCast: migrate\nconst title = (data: any) => (!!data?.title ? data?.title[0]?.plain_text : null)\n\nexport default title\n"],"mappings":"iCACA,MAAM,EAAS,GAAiB,GAAM,MAAQ,GAAM,MAAM,IAAI,WAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.mts","names":[],"sources":["../../../src/utils/getTypes/url.ts"],"mappings":";cAAM,GAAA,GAAO,IAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.mjs","names":[],"sources":["../../../src/utils/getTypes/url.ts"],"sourcesContent":["const url = (data: any) => data.url || null\n\nexport default url\n"],"mappings":"iCAAA,MAAM,EAAO,GAAc,EAAK,KAAO"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import addTime from "./addTime/index.mjs";
|
|
2
|
+
import dataNormalized from "./dataNormalized/index.mjs";
|
|
3
|
+
import dataNormalizedResults from "./dataNormalizedResults/index.mjs";
|
|
4
|
+
import getDataType from "./getDataType/index.mjs";
|
|
5
|
+
import getTitle from "./getTitle/index.mjs";
|
|
6
|
+
import getTypes from "./getTypes/index.mjs";
|
|
7
|
+
export { addTime, dataNormalized, dataNormalizedResults, getDataType, getTitle, getTypes };
|