@jeromefitz/notion 6.1.0 → 6.1.1-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/README.md +12 -12
- package/constants/index.d.mts +1 -1
- package/constants/index.d.mts.map +1 -1
- package/constants/index.mjs.map +1 -1
- package/getTypes-D-cwjcBl.mjs.map +1 -1
- package/{index-CQ1IEP2W.d.mts → index-BAoq6yHe.d.mts} +7 -7
- package/{index-CQ1IEP2W.d.mts.map → index-BAoq6yHe.d.mts.map} +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +61 -63
- package/queries/getBlocksByIdChildren/index.mjs.map +1 -1
- package/queries/getDatabasesByIdQuery/index.d.mts +1 -1
- package/queries/getDatabasesByIdQuery/index.d.mts.map +1 -1
- package/queries/getDatabasesByIdQuery/index.mjs.map +1 -1
- package/queries/getDeepFetchAllChildren/index.mjs.map +1 -1
- package/queries/getInfoType/index.d.mts +0 -2
- package/queries/getInfoType/index.d.mts.map +1 -1
- package/queries/getInfoType/index.mjs.map +1 -1
- package/queries/getNotionListing/index.d.mts.map +1 -1
- package/queries/getNotionListing/index.mjs.map +1 -1
- package/queries/getNotionListingByDate/index.d.mts.map +1 -1
- package/queries/getNotionListingByDate/index.mjs.map +1 -1
- package/queries/getNotionSlug/index.d.mts.map +1 -1
- package/queries/getNotionSlug/index.mjs.map +1 -1
- package/queries/getNotionSlugByRoute/index.d.mts.map +1 -1
- package/queries/getNotionSlugByRoute/index.mjs.map +1 -1
- package/queries/getPagesById/index.mjs.map +1 -1
- package/queries/getPathVariables/index.d.mts +1 -1
- package/queries/getPathVariables/index.mjs.map +1 -1
- package/queries/getQuery/index.d.mts.map +1 -1
- package/queries/getQuery/index.mjs.map +1 -1
- package/schema/index.d.mts +1 -1
- package/utils/addTime/index.d.mts.map +1 -1
- package/utils/addTime/index.mjs.map +1 -1
- package/utils/dataNormalized/index.d.mts.map +1 -1
- package/utils/dataNormalizedResults/index.d.mts.map +1 -1
- package/utils/getDataType/index.d.mts +1 -1
- package/utils/getDataType/index.mjs.map +1 -1
- package/utils/getTitle/index.mjs.map +1 -1
- package/utils/getTypes/_unsupported.d.mts +0 -1
- package/utils/getTypes/_unsupported.d.mts.map +1 -1
- package/utils/getTypes/_unsupported.mjs.map +1 -1
- package/utils/getTypes/checkbox.mjs.map +1 -1
- package/utils/getTypes/date.mjs.map +1 -1
- package/utils/getTypes/email.mjs.map +1 -1
- package/utils/getTypes/files.d.mts.map +1 -1
- package/utils/getTypes/files.mjs.map +1 -1
- package/utils/getTypes/multi_select.mjs.map +1 -1
- package/utils/getTypes/number.mjs.map +1 -1
- package/utils/getTypes/people.mjs.map +1 -1
- package/utils/getTypes/phone_number.mjs.map +1 -1
- package/utils/getTypes/rich_text.mjs.map +1 -1
- package/utils/getTypes/rollup.d.mts.map +1 -1
- package/utils/getTypes/select.mjs.map +1 -1
- package/utils/getTypes/title.mjs.map +1 -1
- package/utils/getTypes/url.mjs.map +1 -1
- package/utils-VfbevQkn.mjs.map +1 -1
package/package.json
CHANGED
|
@@ -1,83 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeromefitz/notion",
|
|
3
|
-
"version": "6.1.
|
|
4
|
-
"
|
|
3
|
+
"version": "6.1.1-canary.1",
|
|
4
|
+
"private": false,
|
|
5
5
|
"description": "Notion: Custom Client for jeromefitzgerald.com",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
6
|
+
"keywords": [
|
|
7
|
+
"next",
|
|
8
|
+
"next.js",
|
|
9
|
+
"notion"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
11
12
|
"author": {
|
|
12
13
|
"name": "Jerome Fitzgerald",
|
|
13
14
|
"email": "j@jeromefitzgerald.com",
|
|
14
15
|
"url": "https://jeromefitzgerald.com"
|
|
15
16
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/JeromeFitz/packages.git",
|
|
20
|
+
"directory": "packages/notion"
|
|
20
21
|
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"sideEffects": false,
|
|
21
24
|
"exports": {
|
|
22
25
|
".": "./index.mjs",
|
|
23
|
-
"./constants": "./
|
|
24
|
-
"./queries": "./
|
|
25
|
-
"./queries/getBlocksByIdChildren": "./
|
|
26
|
-
"./queries/getDatabasesByIdQuery": "./
|
|
27
|
-
"./queries/getDeepFetchAllChildren": "./
|
|
28
|
-
"./queries/getInfoType": "./
|
|
29
|
-
"./queries/getNotionListing": "./
|
|
30
|
-
"./queries/getNotionListingByDate": "./
|
|
31
|
-
"./queries/getNotionSlug": "./
|
|
32
|
-
"./queries/getNotionSlugByRoute": "./
|
|
33
|
-
"./queries/getPagesById": "./
|
|
34
|
-
"./queries/getPathVariables": "./
|
|
35
|
-
"./queries/getQuery": "./
|
|
36
|
-
"./schema": "./
|
|
37
|
-
"./utils": "./
|
|
38
|
-
"./utils/addTime": "./
|
|
39
|
-
"./utils/dataNormalized": "./
|
|
40
|
-
"./utils/dataNormalizedResults": "./
|
|
41
|
-
"./utils/getDataType": "./
|
|
42
|
-
"./utils/getTitle": "./
|
|
43
|
-
"./utils/getTypes": "./
|
|
44
|
-
"./utils/getTypes/_unsupported": "./
|
|
45
|
-
"./utils/getTypes/checkbox": "./
|
|
46
|
-
"./utils/getTypes/date": "./
|
|
47
|
-
"./utils/getTypes/email": "./
|
|
48
|
-
"./utils/getTypes/files": "./
|
|
49
|
-
"./utils/getTypes/multi_select": "./
|
|
50
|
-
"./utils/getTypes/number": "./
|
|
51
|
-
"./utils/getTypes/people": "./
|
|
52
|
-
"./utils/getTypes/phone_number": "./
|
|
53
|
-
"./utils/getTypes/relation": "./
|
|
54
|
-
"./utils/getTypes/rich_text": "./
|
|
55
|
-
"./utils/getTypes/rollup": "./
|
|
56
|
-
"./utils/getTypes/select": "./
|
|
57
|
-
"./utils/getTypes/title": "./
|
|
58
|
-
"./utils/getTypes/url": "./
|
|
26
|
+
"./constants": "./constants/index.mjs",
|
|
27
|
+
"./queries": "./queries/index.mjs",
|
|
28
|
+
"./queries/getBlocksByIdChildren": "./queries/getBlocksByIdChildren/index.mjs",
|
|
29
|
+
"./queries/getDatabasesByIdQuery": "./queries/getDatabasesByIdQuery/index.mjs",
|
|
30
|
+
"./queries/getDeepFetchAllChildren": "./queries/getDeepFetchAllChildren/index.mjs",
|
|
31
|
+
"./queries/getInfoType": "./queries/getInfoType/index.mjs",
|
|
32
|
+
"./queries/getNotionListing": "./queries/getNotionListing/index.mjs",
|
|
33
|
+
"./queries/getNotionListingByDate": "./queries/getNotionListingByDate/index.mjs",
|
|
34
|
+
"./queries/getNotionSlug": "./queries/getNotionSlug/index.mjs",
|
|
35
|
+
"./queries/getNotionSlugByRoute": "./queries/getNotionSlugByRoute/index.mjs",
|
|
36
|
+
"./queries/getPagesById": "./queries/getPagesById/index.mjs",
|
|
37
|
+
"./queries/getPathVariables": "./queries/getPathVariables/index.mjs",
|
|
38
|
+
"./queries/getQuery": "./queries/getQuery/index.mjs",
|
|
39
|
+
"./schema": "./schema/index.mjs",
|
|
40
|
+
"./utils": "./utils/index.mjs",
|
|
41
|
+
"./utils/addTime": "./utils/addTime/index.mjs",
|
|
42
|
+
"./utils/dataNormalized": "./utils/dataNormalized/index.mjs",
|
|
43
|
+
"./utils/dataNormalizedResults": "./utils/dataNormalizedResults/index.mjs",
|
|
44
|
+
"./utils/getDataType": "./utils/getDataType/index.mjs",
|
|
45
|
+
"./utils/getTitle": "./utils/getTitle/index.mjs",
|
|
46
|
+
"./utils/getTypes": "./utils/getTypes/index.mjs",
|
|
47
|
+
"./utils/getTypes/_unsupported": "./utils/getTypes/_unsupported.mjs",
|
|
48
|
+
"./utils/getTypes/checkbox": "./utils/getTypes/checkbox.mjs",
|
|
49
|
+
"./utils/getTypes/date": "./utils/getTypes/date.mjs",
|
|
50
|
+
"./utils/getTypes/email": "./utils/getTypes/email.mjs",
|
|
51
|
+
"./utils/getTypes/files": "./utils/getTypes/files.mjs",
|
|
52
|
+
"./utils/getTypes/multi_select": "./utils/getTypes/multi_select.mjs",
|
|
53
|
+
"./utils/getTypes/number": "./utils/getTypes/number.mjs",
|
|
54
|
+
"./utils/getTypes/people": "./utils/getTypes/people.mjs",
|
|
55
|
+
"./utils/getTypes/phone_number": "./utils/getTypes/phone_number.mjs",
|
|
56
|
+
"./utils/getTypes/relation": "./utils/getTypes/relation.mjs",
|
|
57
|
+
"./utils/getTypes/rich_text": "./utils/getTypes/rich_text.mjs",
|
|
58
|
+
"./utils/getTypes/rollup": "./utils/getTypes/rollup.mjs",
|
|
59
|
+
"./utils/getTypes/select": "./utils/getTypes/select.mjs",
|
|
60
|
+
"./utils/getTypes/title": "./utils/getTypes/title.mjs",
|
|
61
|
+
"./utils/getTypes/url": "./utils/getTypes/url.mjs",
|
|
59
62
|
"./package.json": "./package.json"
|
|
60
63
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
],
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"provenance": true,
|
|
66
|
+
"registry": "https://registry.npmjs.org/"
|
|
67
|
+
},
|
|
66
68
|
"scripts": {
|
|
67
69
|
"build": "tsdown",
|
|
68
70
|
"clean": "rm -rf .turbo && rm -rf dist",
|
|
69
71
|
"clean:install": "pnpm run clean && rm -rf node_modules",
|
|
70
|
-
"copy": "mkdir -p ./dist && ./scripts/copy.sh",
|
|
71
72
|
"dev": "tsdown --watch",
|
|
72
|
-
"lint": "
|
|
73
|
-
"lint:typescript": "tsc --noEmit --declaration",
|
|
73
|
+
"lint:ts": "tsc --noEmit --declaration",
|
|
74
74
|
"semantic-release": "semantic-release",
|
|
75
75
|
"semantic-release:dry": "semantic-release --dry-run"
|
|
76
76
|
},
|
|
77
|
-
"peerDependencies": {
|
|
78
|
-
"@jeromefitz/utils": "^4.0.0",
|
|
79
|
-
"lodash-es": "^4.18.0"
|
|
80
|
-
},
|
|
81
77
|
"dependencies": {
|
|
82
78
|
"@notionhq/client": "4.0.2",
|
|
83
79
|
"date-fns": "4.4.0",
|
|
@@ -88,9 +84,11 @@
|
|
|
88
84
|
"@types/lodash-es": "4.17.12",
|
|
89
85
|
"lodash-es": "4.18.0"
|
|
90
86
|
},
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"@jeromefitz/utils": "^4.0.0",
|
|
89
|
+
"lodash-es": "^4.18.0"
|
|
94
90
|
},
|
|
95
|
-
"
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=24"
|
|
93
|
+
}
|
|
96
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getBlocksByIdChildren/index.ts"],"sourcesContent":["import { avoidRateLimit, isUndefined } from
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getBlocksByIdChildren/index.ts"],"sourcesContent":["import { avoidRateLimit, isUndefined } from \"@jeromefitz/utils\";\n\n// @todo(types)\nconst getBlocksByIdChildren = async ({ block_id, getBlocksChildrenList }) => {\n if (isUndefined(block_id)) return [];\n await avoidRateLimit(0);\n return await getBlocksChildrenList({\n block_id,\n });\n};\n\nexport default getBlocksByIdChildren;\n"],"mappings":"oEAGA,MAAM,EAAwB,MAAO,CAAE,WAAU,2BAC3C,EAAY,CAAQ,EAAU,CAAC,GACnC,MAAM,EAAe,CAAC,EACf,MAAM,EAAsB,CACjC,UACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getDatabasesByIdQuery/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getDatabasesByIdQuery/index.ts"],"mappings":";;;cAaM,qBAAA;EAA+B,WAAA;EAAA,MAAA;EAAA,iBAAA;EAAA;AAAA;;;;UAAA,QAAA;AAAA,MAKpC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getDatabasesByIdQuery/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getDatabasesByIdQuery/index.ts"],"sourcesContent":["import { PROPERTIES } from \"../../constants/index\";\nimport type { SortMock } from \"../../schema/index\";\n\nconst sortDefault: SortMock = {\n sorts: [\n {\n direction: \"ascending\",\n property: PROPERTIES.slug.notion,\n },\n ],\n};\n\n// @todo(types)\nconst getDatabasesByIdQuery = async ({\n database_id,\n filter = sortDefault?.filter,\n getDatabasesQuery,\n sorts = sortDefault?.sorts,\n}) => {\n if (!database_id) return [];\n return await getDatabasesQuery({\n database_id,\n filter,\n sorts,\n });\n};\n\nexport default getDatabasesByIdQuery;\n"],"mappings":"uDAGA,MAAM,EAAwB,CAC5B,MAAO,CACL,CACE,UAAW,YACX,SAAU,EAAW,KAAK,MAC5B,CACF,CACF,EAGM,EAAwB,MAAO,CACnC,cACA,SAAS,GAAa,OACtB,oBACA,QAAQ,GAAa,SAEhB,EACE,MAAM,EAAkB,CAC7B,cACA,SACA,OACF,CAAC,EALwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getDeepFetchAllChildren/index.ts"],"sourcesContent":["const getDeepFetchAllChildren = async ({\n blocks,\n getBlocksChildrenList,\n}): Promise<Array<any | any[]>> => {\n if (blocks === null || blocks === undefined) return blocks
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getDeepFetchAllChildren/index.ts"],"sourcesContent":["const getDeepFetchAllChildren = async ({\n blocks,\n getBlocksChildrenList,\n}): Promise<Array<any | any[]>> => {\n if (blocks === null || blocks === undefined) return blocks;\n const fetchChildrenMap = blocks\n .filter((block: { has_children: any }) => block.has_children)\n .map((parent_block: { id: string }) => {\n const { id: block_id } = parent_block;\n return {\n parent_block,\n promise: getBlocksChildrenList({\n block_id,\n page_size: 100,\n }),\n };\n });\n\n const results = await Promise.all<any>(fetchChildrenMap.map((value) => value.promise));\n\n for (let i = 0; i < results.length; i++) {\n const blocks = results[i].results;\n await getDeepFetchAllChildren({\n blocks,\n getBlocksChildrenList,\n });\n if (fetchChildrenMap[i]) {\n const parent: any = fetchChildrenMap[i].parent_block;\n parent[parent.type].children = blocks;\n }\n }\n return blocks;\n};\n\nexport default getDeepFetchAllChildren;\n"],"mappings":"AAAA,MAAM,EAA0B,MAAO,CACrC,SACA,2BACiC,CACjC,GAAI,GAAW,KAA8B,OAAO,EACpD,IAAM,EAAmB,EACtB,OAAQ,GAAiC,EAAM,YAAY,CAAC,CAC5D,IAAK,GAAiC,CACrC,GAAM,CAAE,GAAI,GAAa,EACzB,MAAO,CACL,eACA,QAAS,EAAsB,CAC7B,WACA,UAAW,GACb,CAAC,CACH,CACF,CAAC,EAEG,EAAU,MAAM,QAAQ,IAAS,EAAiB,IAAK,GAAU,EAAM,OAAO,CAAC,EAErF,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAAK,CACvC,IAAM,EAAS,EAAQ,EAAE,CAAC,QAK1B,GAJA,MAAM,EAAwB,CAC5B,SACA,uBACF,CAAC,EACG,EAAiB,GAAI,CACvB,IAAM,EAAc,EAAiB,EAAE,CAAC,aACxC,EAAO,EAAO,KAAK,CAAC,SAAW,CACjC,CACF,CACA,OAAO,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getInfoType/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getInfoType/index.ts"],"mappings":";cAAM,WAAA;EAAe,MAAA;EAAA,IAAA;EAAA,IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getInfoType/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getInfoType/index.ts"],"sourcesContent":["const getInfoType = ({ config, item, meta, routeType }) => {\n const { NOTION } = config;\n\n let date = \"\";\n const slug = item.properties?.slug;\n\n let as = \"\";\n const href = `/[...catchAll]`;\n\n switch (routeType) {\n case NOTION.BLOG.routeType:\n case NOTION.EVENTS.routeType:\n date = item.properties[NOTION[routeType.toUpperCase()].infoType.key]?.start.slice(0, 10);\n // oxlint-disable-next-line no-unsafe-optional-chaining\n const [year, month, day] = date?.split(\"-\");\n as = `/${routeType}/${year}/${month}/${day}/${slug}`;\n break;\n case NOTION.EPISODES.routeType:\n as = `/${meta?.join(\"/\")}/${slug}`;\n break;\n // case NOTION.PODCASTS.routeType:\n // case NOTION.PEOPLE.routeType:\n // case NOTION.SHOWS.routeType:\n // case NOTION.VENUES.routeType:\n default:\n as = `/${routeType}/${slug}`;\n break;\n }\n\n as = as.replace(\"//\", \"/\");\n\n return {\n as,\n date,\n href,\n slug,\n };\n};\n\nexport default getInfoType;\n"],"mappings":"AAAA,MAAM,GAAe,CAAE,SAAQ,OAAM,OAAM,eAAgB,CACzD,GAAM,CAAE,UAAW,EAEf,EAAO,GACL,EAAO,EAAK,YAAY,KAE1B,EAAK,GAGT,OAAQ,EAAR,CACE,KAAK,EAAO,KAAK,UACjB,KAAK,EAAO,OAAO,UACjB,EAAO,EAAK,WAAW,EAAO,EAAU,YAAY,EAAE,CAAC,SAAS,IAAI,EAAE,MAAM,MAAM,EAAG,EAAE,EAEvF,GAAM,CAAC,EAAM,EAAO,GAAO,GAAM,MAAM,GAAG,EAC1C,EAAK,IAAI,EAAU,GAAG,EAAK,GAAG,EAAM,GAAG,EAAI,GAAG,IAC9C,MACF,KAAK,EAAO,SAAS,UACnB,EAAK,IAAI,GAAM,KAAK,GAAG,EAAE,GAAG,IAC5B,MAKF,QACE,EAAK,IAAI,EAAU,GAAG,IACtB,KACJ,CAIA,MAFA,GAAK,EAAG,QAAQ,KAAM,GAAG,EAElB,CACL,KACA,OACA,sBACA,MACF,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListing/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListing/index.ts"],"mappings":";cAMM,gBAAA;EAA0B,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,YAAA;EAAA,aAAA;EAAA;AAAA;;;;;;;MAO/B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionListing/index.ts"],"sourcesContent":["import { sortObject } from
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionListing/index.ts"],"sourcesContent":["import { sortObject } from \"@jeromefitz/utils\";\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 ?? 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":"6LAMA,MAAM,EAAmB,MAAO,CAC9B,SACA,wBACA,wBACA,eACA,gBACA,eACI,CACJ,GAAM,CAAE,UAAW,EAEf,EAAY,CAAC,EAEX,EAAU,EAAO,EAAU,YAAY,EAAE,CAAC,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,EAAE,CAAC,SAAS,QAAU,EAAW,cAAc,OAaxE,EACJ,IAAa,EAAW,cAAc,OAClC,IAAI,KAAK,YAAY,CAAC,CAAC,YAAY,EACnC,IAAI,KAAK,CAAC,CAAC,YAAY,EAEvB,EAAU,MAAM,EAAsB,CAAE,SAAU,EAAK,EAAG,CAAC,EAC3D,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,YAAY,EAAE,CAAC,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"mappings":";cA0HM,sBAAA;EAAgC,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,YAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQrC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionListingByDate/index.ts"],"sourcesContent":["import { sortObject } from \"@jeromefitz/utils\";\nimport { map as _map, omit as _omit, size as _size } from \"lodash-es\";\n\nimport { PROPERTIES, QUERIES } from \"../../constants/index\";\nimport type { SortItem } from \"../../schema/index\";\nimport { addTime, dataNormalized } from \"../../utils/index\";\n\nconst getNotionListingByDate__getFilter = ({ config, pathVariables, routeType, slug }) => {\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\"}-${day ? day : \"01\"}`,\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 ?? 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":"iQAOA,MAAM,GAAqC,CAAE,SAAQ,gBAAe,YAAW,UAAW,CACxF,GAAM,CAAE,UAAW,EACb,CAAE,QAAS,EACX,CAAC,EAAM,EAAO,GAAO,EACrB,EAAYA,EAAM,CAAI,EAEtB,EAAgB,IAAI,KAAK,CAAC,CAAC,YAAY,EACvC,EAAiB,IAAI,KACzB,GAAG,GAAc,EAAc,MAAM,EAAG,CAAC,EAAE,GAAG,GAAgB,KAAK,GAAG,GAAY,MACpF,EAUM,EACJ,EAAO,EAAU,YAAY,EAAE,EAAE,UAAU,QAAU,EAAW,cAAc,OAEhF,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,EAAE,CAAC,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,EAAE,CAAC,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlug/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlug/index.ts"],"mappings":";cAMM,aAAA;EAAuB,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,uBAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQ5B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionSlug/index.ts"],"sourcesContent":["import { sortObject } from
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_omit"],"sources":["../../../src/queries/getNotionSlug/index.ts"],"sourcesContent":["import { sortObject } from \"@jeromefitz/utils\";\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":"iLAMA,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,CAAC,CAAC,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,EAAQ,CAAC,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,EACN,CAAS,OAAQ,CAAC,CAcrE,EAAS,OAAQ,CAAC,EAAG,OAAM,MAAO,CAAC,CAAE,CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"mappings":";cAuJM,oBAAA;EAA8B,MAAA;EAAA,qBAAA;EAAA,qBAAA;EAAA,QAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA;;;;;;;;MAQnC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"sourcesContent":["import { sortObject } from
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_size","_omit"],"sources":["../../../src/queries/getNotionSlugByRoute/index.ts"],"sourcesContent":["import { sortObject } from \"@jeromefitz/utils\";\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: NOTION[isChild ? NOTION[CHILD].routeType.toUpperCase() : ROUTE_TYPE].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\"}-${day ? day : \"01\"}`,\n );\n const property =\n NOTION[routeType.toUpperCase()]?.infoType?.notion ?? 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 (ROUTE_TYPES_BY_DATA_TYPES[DATA_TYPES.LISTING_BY_DATE].includes(routeType.toUpperCase())) {\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":"wQAmBA,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,EAAW,EAAE,UAAU,YAAY,EAElD,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,EAAO,EAAM,CAAC,UAAU,YAAY,EAAI,EAAW,CAAC,YAClF,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,EAAM,CAAC,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,CAAC,CAAC,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,GAAG,GAAY,MACpF,EACM,EACJ,EAAO,EAAU,YAAY,EAAE,EAAE,UAAU,QAAU,EAAW,cAAc,OAE1E,EAAc,MAAM,EAAsB,CAC9C,YAAa,EAAO,EAAU,YAAY,EAAE,CAAC,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,EAqC9C,OA5BI,EAAO,GAAW,YAAY,EAAE,EAAE,SAC7B,MAAM,EAA+C,CAC1D,SACA,wBACA,wBACA,WACA,gBACA,WAEF,CAAC,EAOC,EAA0B,EAAW,gBAAgB,CAAC,SAAS,EAAU,YAAY,CAAC,EACjF,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/queries/getPagesById/index.ts"],"sourcesContent":["import { avoidRateLimit, isUndefined } from
|
|
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 +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
|
|
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) ? _drop(catchAll) : _drop(_dropRight(catchAll));\n\n const routeType =\n first === last && !_includes(ROUTE_TYPES, FIRST) ? NOTION.PAGES.routeType : first;\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,EAAIC,EAAM,CAAQ,EAAIA,EAAMC,EAAW,CAAQ,CAAC,EAEnF,EACJN,IAAUE,GAAQ,CAACE,EAAU,EAAa,CAAK,EAAI,EAAO,MAAM,UAAYJ,EACxE,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getQuery/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/queries/getQuery/index.ts"],"mappings":";cAmBM,QAAA;EAAkB,MAAA;EAAA,oBAAA;EAAA;AAAA;;;;MAA0C,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_map","_omit"],"sources":["../../../src/queries/getQuery/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_map","_omit"],"sources":["../../../src/queries/getQuery/index.ts"],"sourcesContent":["import { avoidRateLimit, isObjectEmpty } from \"@jeromefitz/utils\";\nimport { map as _map, omit as _omit, size as _size } from \"lodash-es\";\n\nimport { PROPERTIES } from \"../../constants/index\";\nimport type { SortItem } from \"../../schema/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// oxlint-disable-next-line complexity\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 // oxlint-disable-next-line no-unused-expressions\n !!podcasts && podcastIds.push(...podcasts?.split(\",\"));\n // oxlint-disable-next-line no-unused-expressions\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 // oxlint-disable-next-line no-extra-boolean-cast\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":"yNAUA,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,EAAc,CAAC,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,EAErD,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,KAEE,GAAW,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/schema/index.d.mts
CHANGED
|
@@ -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-
|
|
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-BAoq6yHe.mjs";
|
|
2
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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/addTime/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/addTime/index.ts"],"mappings":";cAEM,OAAA,GAAW,IAAA,OAAM,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["_addDays","_addMonths","_addYears"],"sources":["../../../src/utils/addTime/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_addDays","_addMonths","_addYears"],"sources":["../../../src/utils/addTime/index.ts"],"sourcesContent":["import { addDays as _addDays, addMonths as _addMonths, addYears as _addYears } 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":"gEAEA,MAAM,GAAW,EAAM,IAAS,CAC9B,OAAQ,EAAR,CACE,IAAK,MAEH,OAAOA,EAAS,EAAM,CAAC,CAAC,CAAC,YAAY,EACvC,IAAK,QACH,OAAOC,EAAW,EAAM,CAAC,CAAC,CAAC,YAAY,EACzC,IAAK,OACH,OAAOC,EAAU,EAAM,CAAC,CAAC,CAAC,YAAY,CAC1C,CACA,OAAOF,EAAS,EAAM,EAAE,CAAC,CAAC,YAAY,CACxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/dataNormalized/index.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/dataNormalized/index.ts"],"mappings":";;;;;;cAWM,cAAA;EAAkB,MAAA;EAAA,IAAA;EAAA,MAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/dataNormalizedResults/index.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/utils/dataNormalizedResults/index.ts"],"mappings":";;;;;;;cAWM,qBAAA;EAAyB,MAAA;EAAA,OAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/getDataType/index.ts"],"sourcesContent":["import { DATA_TYPES } from
|
|
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.mjs","names":["_last"],"sources":["../../../src/utils/getTitle/index.ts"],"sourcesContent":["import { last as _last } from
|
|
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 // oxlint-disable-next-line no-extra-boolean-cast\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,CAAC,CAChC,QAAQ,UAAW,kBAAkB,CAAC,CACtC,QAAQ,YAAa,oBAAoB,CAIhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_unsupported.d.mts","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"_unsupported.d.mts","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"mappings":";cAAM,YAAA,GAAgB,IAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_unsupported.mjs","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"_unsupported.mjs","names":[],"sources":["../../../src/utils/getTypes/_unsupported.ts"],"sourcesContent":["const _unsupported = (data: any) => {\n console.dir(`@notion(_unsupported)`);\n // console.dir(data)\n return data;\n};\n\nexport default _unsupported;\n"],"mappings":"AAAA,MAAM,EAAgB,IACpB,QAAQ,IAAI,uBAAuB,EAE5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.mjs","names":[],"sources":["../../../src/utils/getTypes/checkbox.ts"],"sourcesContent":["const checkbox = (data: any) => data.checkbox || false
|
|
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.mjs","names":[],"sources":["../../../src/utils/getTypes/date.ts"],"sourcesContent":["const date = (data: any) => {\n const { type } = data
|
|
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.mjs","names":[],"sources":["../../../src/utils/getTypes/email.ts"],"sourcesContent":["const email = (data: any) => data.email || null
|
|
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":";
|
|
1
|
+
{"version":3,"file":"files.d.mts","names":[],"sources":["../../../src/utils/getTypes/files.ts"],"mappings":";cAWM,KAAA,GAAS,IAAA,OAAW,MAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","names":["_size"],"sources":["../../../src/utils/getTypes/files.ts"],"sourcesContent":["import { stringToUUID } from
|
|
1
|
+
{"version":3,"file":"files.mjs","names":["_size"],"sources":["../../../src/utils/getTypes/files.ts"],"sourcesContent":["import { stringToUUID } from \"@jeromefitz/utils\";\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 // oxlint-disable-next-line complexity\n data.files.map((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 return _files;\n};\n\nexport default files;\n"],"mappings":"gHAIA,MAEM,GAAsB,EAAgC,IAC1D,yFACG,QAAQ,eAAgB,mBAAmB,CAAG,CAAC,CAAC,CAChD,QAAQ,cAAe,EAAa,CAAM,CAAC,EAE1C,GAAS,EAAW,IAAmB,CAC3C,IAAM,EAAU,IAAI,EACd,EAAS,CAAC,EAkDhB,OAhDIA,EAAM,EAAK,KAAK,GAAK,GAEzB,EAAK,MAAM,IAAK,GAA6E,CAC3F,GAAI,GAAM,OAAS,OAAQ,CACzB,IAAM,EAAc,GAAM,MAAM,IAAI,MAAM,GAAG,CAAC,CAAC,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,CAAC,CAAC,GAC7C,EAAe,EAAQ,KAAK,CAAW,EAS7C,EAAO,GAAgB,CACrB,KAAM,GAAM,KACZ,IAAK,CAGP,CACF,CAQF,CAAC,EA9CkC,CAiDrC"}
|