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