contentlayer-source-notion
Advanced tools
Comparing version 0.0.1-alpha.14 to 0.0.1-alpha.15
@@ -16,7 +16,9 @@ import * as tracing_1 from "@effect-ts/core/Tracing"; | ||
const databaseTypeDefs = (Array.isArray(databaseTypes) ? databaseTypes : Object.values(databaseTypes)).map((_) => _.def()); | ||
const client = new notion.Client({ | ||
fetch: fetchNotion, | ||
...rest.clientOptions, | ||
}); | ||
const renderer = new NotionRenderer({ client, ...rest.rendererOptions }); | ||
const client = rest.client instanceof notion.Client | ||
? rest.client | ||
: new notion.Client({ | ||
fetch: fetchNotion, | ||
...rest.client, | ||
}); | ||
const renderer = rest.renderer instanceof NotionRenderer ? rest.renderer : new NotionRenderer({ client, ...rest.renderer }); | ||
return { | ||
@@ -26,10 +28,10 @@ type: 'notion', | ||
options, | ||
provideSchema: () => (T.provideService(NotionRendererTag)(renderer, fileName_1 + ":41:44")(T.provideService(NotionClient)(client, fileName_1 + ":40:39")(provideSchema({ databaseTypeDefs, options })))), | ||
fetchData: ({ schemaDef }) => (S.fromEffect((T.provideService(NotionRendererTag)(renderer, fileName_1 + ":54:48")(T.provideService(NotionClient)(client, fileName_1 + ":53:43")(T.either(fetchAllDocuments({ | ||
provideSchema: () => (T.provideService(NotionRendererTag)(renderer, fileName_1 + ":46:44")(T.provideService(NotionClient)(client, fileName_1 + ":45:39")(provideSchema({ databaseTypeDefs, options })))), | ||
fetchData: ({ schemaDef }) => (S.fromEffect((T.provideService(NotionRendererTag)(renderer, fileName_1 + ":59:48")(T.provideService(NotionClient)(client, fileName_1 + ":58:43")(T.either(fetchAllDocuments({ | ||
databaseTypeDefs: databaseTypeDefs.map((databaseTypeDef) => flattendDatabaseTypeDef(databaseTypeDef)), | ||
schemaDef, | ||
options, | ||
}), fileName_1 + ":52:21")))))), | ||
}), fileName_1 + ":57:21")))))), | ||
}; | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -6,4 +6,4 @@ import type * as core from '@contentlayer/core'; | ||
export type PluginOptions = { | ||
clientOptions?: ConstructorParameters<typeof notion.Client>[0]; | ||
rendererOptions?: ConstructorParameters<typeof NotionRenderer>[0]; | ||
client?: ConstructorParameters<typeof notion.Client>[0] | notion.Client; | ||
renderer?: ConstructorParameters<typeof NotionRenderer>[0] | NotionRenderer; | ||
databaseTypes: DatabaseTypes; | ||
@@ -10,0 +10,0 @@ }; |
{ | ||
"name": "contentlayer-source-notion", | ||
"version": "0.0.1-alpha.14", | ||
"version": "0.0.1-alpha.15", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": "./dist/index.js", |
@@ -27,8 +27,13 @@ import type * as core from '@contentlayer/core' | ||
const client = new notion.Client({ | ||
fetch: fetchNotion, | ||
...rest.clientOptions, | ||
}) | ||
const renderer = new NotionRenderer({ client, ...rest.rendererOptions }) | ||
const client = | ||
rest.client instanceof notion.Client | ||
? rest.client | ||
: new notion.Client({ | ||
fetch: fetchNotion, | ||
...rest.client, | ||
}) | ||
const renderer = | ||
rest.renderer instanceof NotionRenderer ? rest.renderer : new NotionRenderer({ client, ...rest.renderer }) | ||
return { | ||
@@ -35,0 +40,0 @@ type: 'notion', |
@@ -8,4 +8,4 @@ import type * as core from '@contentlayer/core' | ||
export type PluginOptions = { | ||
clientOptions?: ConstructorParameters<typeof notion.Client>[0] | ||
rendererOptions?: ConstructorParameters<typeof NotionRenderer>[0] | ||
client?: ConstructorParameters<typeof notion.Client>[0] | notion.Client | ||
renderer?: ConstructorParameters<typeof NotionRenderer>[0] | NotionRenderer | ||
databaseTypes: DatabaseTypes | ||
@@ -12,0 +12,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
164965
2246