@jeromefitz/notion 6.1.0 → 6.2.0-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/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-lint$colon$ts.log +1 -0
- package/README.md +12 -12
- package/{constants → dist/constants}/index.d.mts +1 -1
- package/{constants → dist/constants}/index.d.mts.map +1 -1
- package/dist/constants/index.mjs.map +1 -0
- package/dist/get-types-7QEbhRzY.mjs +2 -0
- package/dist/get-types-7QEbhRzY.mjs.map +1 -0
- package/{index-CQ1IEP2W.d.mts → dist/index-BAoq6yHe.d.mts} +7 -7
- package/{index-CQ1IEP2W.d.mts.map → dist/index-BAoq6yHe.d.mts.map} +1 -1
- package/{index.d.mts → dist/index.d.mts} +1 -1
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/{queries/getBlocksByIdChildren → dist/queries/get-blocks-by-id-children}/index.d.mts +1 -1
- package/dist/queries/get-blocks-by-id-children/index.d.mts.map +1 -0
- package/dist/queries/get-blocks-by-id-children/index.mjs.map +1 -0
- package/{queries/getDatabasesByIdQuery → dist/queries/get-databases-by-id-query}/index.d.mts +2 -2
- package/dist/queries/get-databases-by-id-query/index.d.mts.map +1 -0
- package/dist/queries/get-databases-by-id-query/index.mjs.map +1 -0
- package/{queries/getDeepFetchAllChildren → dist/queries/get-deep-fetch-all-children}/index.d.mts +1 -1
- package/dist/queries/get-deep-fetch-all-children/index.d.mts.map +1 -0
- package/dist/queries/get-deep-fetch-all-children/index.mjs.map +1 -0
- package/{queries/getInfoType → dist/queries/get-info-type}/index.d.mts +1 -3
- package/dist/queries/get-info-type/index.d.mts.map +1 -0
- package/dist/queries/get-info-type/index.mjs.map +1 -0
- package/{queries/getNotionListing → dist/queries/get-notion-listing}/index.d.mts +1 -1
- package/dist/queries/get-notion-listing/index.d.mts.map +1 -0
- package/dist/queries/get-notion-listing/index.mjs +2 -0
- package/dist/queries/get-notion-listing/index.mjs.map +1 -0
- package/{queries/getNotionListingByDate → dist/queries/get-notion-listing-by-date}/index.d.mts +1 -1
- package/dist/queries/get-notion-listing-by-date/index.d.mts.map +1 -0
- package/dist/queries/get-notion-listing-by-date/index.mjs +2 -0
- package/dist/queries/get-notion-listing-by-date/index.mjs.map +1 -0
- package/{queries/getNotionSlug → dist/queries/get-notion-slug}/index.d.mts +1 -1
- package/dist/queries/get-notion-slug/index.d.mts.map +1 -0
- package/dist/queries/get-notion-slug/index.mjs +2 -0
- package/dist/queries/get-notion-slug/index.mjs.map +1 -0
- package/{queries/getNotionSlugByRoute → dist/queries/get-notion-slug-by-route}/index.d.mts +1 -1
- package/dist/queries/get-notion-slug-by-route/index.d.mts.map +1 -0
- package/dist/queries/get-notion-slug-by-route/index.mjs +2 -0
- package/dist/queries/get-notion-slug-by-route/index.mjs.map +1 -0
- package/{queries/getPagesById → dist/queries/get-pages-by-id}/index.d.mts +1 -1
- package/dist/queries/get-pages-by-id/index.d.mts.map +1 -0
- package/dist/queries/get-pages-by-id/index.mjs.map +1 -0
- package/{queries/getPathVariables → dist/queries/get-path-variables}/index.d.mts +2 -2
- package/dist/queries/get-path-variables/index.d.mts.map +1 -0
- package/dist/queries/get-path-variables/index.mjs +2 -0
- package/dist/queries/get-path-variables/index.mjs.map +1 -0
- package/{queries/getQuery → dist/queries/get-query}/index.d.mts +1 -1
- package/dist/queries/get-query/index.d.mts.map +1 -0
- package/dist/queries/get-query/index.mjs +2 -0
- package/dist/queries/get-query/index.mjs.map +1 -0
- package/dist/queries/index.d.mts +12 -0
- package/dist/queries/index.mjs +1 -0
- package/{schema → dist/schema}/index.d.mts +1 -1
- package/{utils/addTime → dist/utils/add-time}/index.d.mts +1 -1
- package/dist/utils/add-time/index.d.mts.map +1 -0
- package/dist/utils/add-time/index.mjs.map +1 -0
- package/{utils/dataNormalized → dist/utils/data-normalized}/index.d.mts +1 -1
- package/dist/utils/data-normalized/index.d.mts.map +1 -0
- package/dist/utils/data-normalized/index.mjs +1 -0
- package/{utils/dataNormalizedResults → dist/utils/data-normalized-results}/index.d.mts +1 -1
- package/dist/utils/data-normalized-results/index.d.mts.map +1 -0
- package/dist/utils/data-normalized-results/index.mjs +1 -0
- package/{utils/getDataType → dist/utils/get-data-type}/index.d.mts +2 -2
- package/dist/utils/get-data-type/index.d.mts.map +1 -0
- package/dist/utils/get-data-type/index.mjs.map +1 -0
- package/{utils/getTitle → dist/utils/get-title}/index.d.mts +1 -1
- package/dist/utils/get-title/index.d.mts.map +1 -0
- package/dist/utils/get-title/index.mjs.map +1 -0
- package/dist/utils/get-types/_unsupported.d.mts +5 -0
- package/dist/utils/get-types/_unsupported.d.mts.map +1 -0
- package/dist/utils/get-types/_unsupported.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/checkbox.d.mts +1 -1
- package/dist/utils/get-types/checkbox.d.mts.map +1 -0
- package/dist/utils/get-types/checkbox.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/date.d.mts +1 -1
- package/dist/utils/get-types/date.d.mts.map +1 -0
- package/dist/utils/get-types/date.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/email.d.mts +1 -1
- package/dist/utils/get-types/email.d.mts.map +1 -0
- package/dist/utils/get-types/email.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/files.d.mts +1 -1
- package/dist/utils/get-types/files.d.mts.map +1 -0
- package/dist/utils/get-types/files.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/index.d.mts +1 -1
- package/{utils/getTypes → dist/utils/get-types}/index.d.mts.map +1 -1
- package/dist/utils/get-types/index.mjs +1 -0
- package/{utils/getTypes/multi_select.d.mts → dist/utils/get-types/multi-select.d.mts} +2 -2
- package/dist/utils/get-types/multi-select.d.mts.map +1 -0
- package/{utils/getTypes/multi_select.mjs → dist/utils/get-types/multi-select.mjs} +1 -1
- package/dist/utils/get-types/multi-select.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/number.d.mts +1 -1
- package/dist/utils/get-types/number.d.mts.map +1 -0
- package/dist/utils/get-types/number.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/people.d.mts +1 -1
- package/dist/utils/get-types/people.d.mts.map +1 -0
- package/dist/utils/get-types/people.mjs.map +1 -0
- package/{utils/getTypes/phone_number.d.mts → dist/utils/get-types/phone-number.d.mts} +2 -2
- package/dist/utils/get-types/phone-number.d.mts.map +1 -0
- package/{utils/getTypes/phone_number.mjs → dist/utils/get-types/phone-number.mjs} +1 -1
- package/dist/utils/get-types/phone-number.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/relation.d.mts +1 -1
- package/dist/utils/get-types/relation.d.mts.map +1 -0
- package/dist/utils/get-types/relation.mjs +1 -0
- package/{utils/getTypes/rich_text.d.mts → dist/utils/get-types/rich-text.d.mts} +2 -2
- package/dist/utils/get-types/rich-text.d.mts.map +1 -0
- package/{utils/getTypes/rich_text.mjs → dist/utils/get-types/rich-text.mjs} +1 -1
- package/dist/utils/get-types/rich-text.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/rollup.d.mts +1 -1
- package/dist/utils/get-types/rollup.d.mts.map +1 -0
- package/dist/utils/get-types/rollup.mjs +1 -0
- package/{utils/getTypes → dist/utils/get-types}/select.d.mts +1 -1
- package/dist/utils/get-types/select.d.mts.map +1 -0
- package/dist/utils/get-types/select.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/title.d.mts +1 -1
- package/dist/utils/get-types/title.d.mts.map +1 -0
- package/dist/utils/get-types/title.mjs.map +1 -0
- package/{utils/getTypes → dist/utils/get-types}/url.d.mts +1 -1
- package/{utils/getTypes → dist/utils/get-types}/url.d.mts.map +1 -1
- package/dist/utils/get-types/url.mjs.map +1 -0
- package/dist/utils/index.d.mts +7 -0
- package/dist/utils/index.mjs +1 -0
- package/dist/utils-SxsCJsDP.mjs +2 -0
- package/dist/utils-SxsCJsDP.mjs.map +1 -0
- package/package.json +213 -64
- package/release.config.js +25 -0
- package/src/constants/index.ts +1326 -0
- package/src/index.ts +151 -0
- package/src/queries/get-blocks-by-id-children/index.ts +12 -0
- package/src/queries/get-databases-by-id-query/index.ts +28 -0
- package/src/queries/get-deep-fetch-all-children/index.ts +35 -0
- package/src/queries/get-info-type/index.ts +40 -0
- package/src/queries/get-notion-listing/index.ts +91 -0
- package/src/queries/get-notion-listing-by-date/index.ts +190 -0
- package/src/queries/get-notion-slug/index.ts +64 -0
- package/src/queries/get-notion-slug-by-route/index.ts +201 -0
- package/src/queries/get-pages-by-id/index.ts +12 -0
- package/src/queries/get-path-variables/index.ts +60 -0
- package/src/queries/get-query/index.ts +140 -0
- package/src/queries/index.ts +25 -0
- package/src/schema/index.ts +386 -0
- package/src/utils/add-time/index.ts +16 -0
- package/src/utils/data-normalized/index.ts +49 -0
- package/src/utils/data-normalized-results/index.ts +29 -0
- package/src/utils/get-data-type/index.ts +62 -0
- package/src/utils/get-title/index.ts +21 -0
- package/src/utils/get-types/_unsupported.ts +7 -0
- package/src/utils/get-types/checkbox.ts +3 -0
- package/src/utils/get-types/date.ts +6 -0
- package/src/utils/get-types/email.ts +3 -0
- package/src/utils/get-types/files.ts +67 -0
- package/src/utils/get-types/index.ts +41 -0
- package/src/utils/get-types/multi-select.ts +16 -0
- package/src/utils/get-types/number.ts +6 -0
- package/src/utils/get-types/people.ts +22 -0
- package/src/utils/get-types/phone-number.ts +3 -0
- package/src/utils/get-types/relation.ts +18 -0
- package/src/utils/get-types/rich-text.ts +5 -0
- package/src/utils/get-types/rollup.ts +30 -0
- package/src/utils/get-types/select.ts +21 -0
- package/src/utils/get-types/title.ts +4 -0
- package/src/utils/get-types/url.ts +3 -0
- package/src/utils/index.ts +16 -0
- package/tsconfig.json +15 -0
- package/tsdown.config.ts +14 -0
- package/constants/index.mjs.map +0 -1
- package/getTypes-D-cwjcBl.mjs +0 -2
- package/getTypes-D-cwjcBl.mjs.map +0 -1
- package/index.d.mts.map +0 -1
- package/index.mjs +0 -2
- package/index.mjs.map +0 -1
- package/queries/getBlocksByIdChildren/index.d.mts.map +0 -1
- package/queries/getBlocksByIdChildren/index.mjs.map +0 -1
- package/queries/getDatabasesByIdQuery/index.d.mts.map +0 -1
- package/queries/getDatabasesByIdQuery/index.mjs.map +0 -1
- package/queries/getDeepFetchAllChildren/index.d.mts.map +0 -1
- package/queries/getDeepFetchAllChildren/index.mjs.map +0 -1
- package/queries/getInfoType/index.d.mts.map +0 -1
- package/queries/getInfoType/index.mjs.map +0 -1
- package/queries/getNotionListing/index.d.mts.map +0 -1
- package/queries/getNotionListing/index.mjs +0 -2
- package/queries/getNotionListing/index.mjs.map +0 -1
- package/queries/getNotionListingByDate/index.d.mts.map +0 -1
- package/queries/getNotionListingByDate/index.mjs +0 -2
- package/queries/getNotionListingByDate/index.mjs.map +0 -1
- package/queries/getNotionSlug/index.d.mts.map +0 -1
- package/queries/getNotionSlug/index.mjs +0 -2
- package/queries/getNotionSlug/index.mjs.map +0 -1
- package/queries/getNotionSlugByRoute/index.d.mts.map +0 -1
- package/queries/getNotionSlugByRoute/index.mjs +0 -2
- package/queries/getNotionSlugByRoute/index.mjs.map +0 -1
- package/queries/getPagesById/index.d.mts.map +0 -1
- package/queries/getPagesById/index.mjs.map +0 -1
- package/queries/getPathVariables/index.d.mts.map +0 -1
- package/queries/getPathVariables/index.mjs +0 -2
- package/queries/getPathVariables/index.mjs.map +0 -1
- package/queries/getQuery/index.d.mts.map +0 -1
- package/queries/getQuery/index.mjs +0 -2
- package/queries/getQuery/index.mjs.map +0 -1
- package/queries/index.d.mts +0 -12
- package/queries/index.mjs +0 -1
- package/utils/addTime/index.d.mts.map +0 -1
- package/utils/addTime/index.mjs.map +0 -1
- package/utils/dataNormalized/index.d.mts.map +0 -1
- package/utils/dataNormalized/index.mjs +0 -1
- package/utils/dataNormalizedResults/index.d.mts.map +0 -1
- package/utils/dataNormalizedResults/index.mjs +0 -1
- package/utils/getDataType/index.d.mts.map +0 -1
- package/utils/getDataType/index.mjs.map +0 -1
- package/utils/getTitle/index.d.mts.map +0 -1
- package/utils/getTitle/index.mjs.map +0 -1
- package/utils/getTypes/_unsupported.d.mts +0 -6
- package/utils/getTypes/_unsupported.d.mts.map +0 -1
- package/utils/getTypes/_unsupported.mjs.map +0 -1
- package/utils/getTypes/checkbox.d.mts.map +0 -1
- package/utils/getTypes/checkbox.mjs.map +0 -1
- package/utils/getTypes/date.d.mts.map +0 -1
- package/utils/getTypes/date.mjs.map +0 -1
- package/utils/getTypes/email.d.mts.map +0 -1
- package/utils/getTypes/email.mjs.map +0 -1
- package/utils/getTypes/files.d.mts.map +0 -1
- package/utils/getTypes/files.mjs.map +0 -1
- package/utils/getTypes/index.mjs +0 -1
- package/utils/getTypes/multi_select.d.mts.map +0 -1
- package/utils/getTypes/multi_select.mjs.map +0 -1
- package/utils/getTypes/number.d.mts.map +0 -1
- package/utils/getTypes/number.mjs.map +0 -1
- package/utils/getTypes/people.d.mts.map +0 -1
- package/utils/getTypes/people.mjs.map +0 -1
- package/utils/getTypes/phone_number.d.mts.map +0 -1
- package/utils/getTypes/phone_number.mjs.map +0 -1
- package/utils/getTypes/relation.d.mts.map +0 -1
- package/utils/getTypes/relation.mjs +0 -1
- package/utils/getTypes/rich_text.d.mts.map +0 -1
- package/utils/getTypes/rich_text.mjs.map +0 -1
- package/utils/getTypes/rollup.d.mts.map +0 -1
- package/utils/getTypes/rollup.mjs +0 -1
- package/utils/getTypes/select.d.mts.map +0 -1
- package/utils/getTypes/select.mjs.map +0 -1
- package/utils/getTypes/title.d.mts.map +0 -1
- package/utils/getTypes/title.mjs.map +0 -1
- package/utils/getTypes/url.mjs.map +0 -1
- package/utils/index.d.mts +0 -7
- package/utils/index.mjs +0 -1
- package/utils-VfbevQkn.mjs +0 -2
- package/utils-VfbevQkn.mjs.map +0 -1
- /package/{constants → dist/constants}/index.mjs +0 -0
- /package/{queries/getBlocksByIdChildren → dist/queries/get-blocks-by-id-children}/index.mjs +0 -0
- /package/{queries/getDatabasesByIdQuery → dist/queries/get-databases-by-id-query}/index.mjs +0 -0
- /package/{queries/getDeepFetchAllChildren → dist/queries/get-deep-fetch-all-children}/index.mjs +0 -0
- /package/{queries/getInfoType → dist/queries/get-info-type}/index.mjs +0 -0
- /package/{queries/getPagesById → dist/queries/get-pages-by-id}/index.mjs +0 -0
- /package/{schema → dist/schema}/index.mjs +0 -0
- /package/{utils/addTime → dist/utils/add-time}/index.mjs +0 -0
- /package/{utils/getDataType → dist/utils/get-data-type}/index.mjs +0 -0
- /package/{utils/getTitle → dist/utils/get-title}/index.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/_unsupported.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/checkbox.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/date.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/email.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/files.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/number.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/people.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/select.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/title.mjs +0 -0
- /package/{utils/getTypes → dist/utils/get-types}/url.mjs +0 -0
|
@@ -0,0 +1,386 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,49 @@
|
|
|
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;
|
|
@@ -0,0 +1,29 @@
|
|
|
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;
|
|
@@ -0,0 +1,62 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
@@ -0,0 +1,67 @@
|
|
|
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;
|
|
@@ -0,0 +1,41 @@
|
|
|
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;
|