Skip to content

Commit a48a942

Browse files
Publish notion: new version
1 parent 015a9fe commit a48a942

File tree

7 files changed

+35
-20
lines changed

7 files changed

+35
-20
lines changed

engine-idk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@poozle/engine-idk",
3-
"version": "0.1.22",
3+
"version": "0.1.24",
44
"description": "Used to develop integrations for Poozle",
55
"license": "MIT",
66
"author": "Poozle <support@poozle.in>",

engine-idk/src/common_models/documentation/block.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface Block {
2323

2424
export enum BlockType {
2525
bookmark = 'bookmark',
26+
bookmark_text = 'bookmark_text',
2627
breadcrumb = 'breadcrumb',
2728
bulleted_list_item = 'bulleted_list_item',
2829
callout = 'callout',
@@ -48,6 +49,7 @@ export enum BlockType {
4849
table = 'table',
4950
table_of_contents = 'table_of_contents',
5051
table_row = 'table_row',
52+
table_cell = 'table_cell',
5153
template = 'template',
5254
to_do = 'to_do',
5355
toggle = 'toggle',

integration_definitions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
"name": "Notion",
8585
"key": "notion",
8686
"icon": "notion.svg",
87-
"version": "0.1.7",
87+
"version": "0.1.8",
8888
"releaseStage": "ALPHA",
89-
"sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/documentation/notion/0.1.7/index.js",
89+
"sourceUrl": "https://raw.githubusercontent.com/poozlehq/build-artifacts/main/documentation/notion/0.1.8/index.js",
9090
"integrationType": "DOCUMENTATION"
9191
},
9292
{

integrations/documentation/notion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"access": "public"
4848
},
4949
"dependencies": {
50-
"@poozle/engine-idk": "^0.1.23",
50+
"@poozle/engine-idk": "^0.1.24",
5151
"axios": "^1.4.0"
5252
},
5353
"browserslist": {

integrations/documentation/notion/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import { BaseIntegration, CheckResponse, Config, SpecificationResponse } from '@poozle/engine-idk';
44
import axios from 'axios';
5+
import { ProxyPath } from 'proxy';
56

67
import { BlocksPath } from 'models/block/blocks.path';
78
import { PagePath } from 'models/page/page.path';
89
import { PagesPath } from 'models/page/pages.path';
9-
import { ProxyPath } from 'proxy';
1010

1111
import spec from './spec';
1212

integrations/documentation/notion/src/models/block/block.utils.ts

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export async function fetchPageBlocks(
151151
};
152152
}
153153

154+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
154155
export function extractContent(data: any): Content[] {
155156
const type = data.type;
156157
switch (type) {
@@ -184,7 +185,8 @@ export function extractContent(data: any): Content[] {
184185

185186
default:
186187
return 'rich_text' in data[type]
187-
? data[type]?.rich_text?.map((richtext: any) => {
188+
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
189+
data[type]?.rich_text?.map((richtext: any) => {
188190
return {
189191
annotations: {
190192
bold: richtext.annotations.bold ?? '',
@@ -206,11 +208,13 @@ export function extractChildrenData(data: SingleBlockResponse): Block[] {
206208
if (data.type === BlockType.table_row) {
207209
const cells = data[data.type].cells ? data[data.type].cells : [];
208210

211+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
209212
return cells.map((cell: any) => ({
210213
id: data.id,
211214
parent_id: data.parent?.type ? data.parent[data.parent.type] : '',
212215
block_type: BlockType.table_cell,
213216
content: [
217+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
214218
...cell?.map((richtext: any) => ({
215219
annotations: {
216220
bold: richtext.annotations.bold ?? '',
@@ -230,17 +234,26 @@ export function extractChildrenData(data: SingleBlockResponse): Block[] {
230234

231235
const caption = data[data.type].caption ? data[data.type].caption : [];
232236

237+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
233238
return caption.map((richtext: any) => ({
234-
annotations: {
235-
bold: richtext.annotations.bold ?? '',
236-
italic: richtext.annotations.italic ?? '',
237-
strikethrough: richtext.annotations.strikethrough ?? '',
238-
underline: richtext.annotations.underline ?? '',
239-
code: richtext.annotations.code ?? '',
240-
color: richtext.annotations.color ?? '',
241-
},
242-
plain_text: richtext.plain_text,
243-
href: richtext.href,
239+
id: data.id,
240+
parent_id: data.parent?.type ? data.parent[data.parent.type] : '',
241+
block_type: BlockType.bookmark_text,
242+
content: [
243+
{
244+
annotations: {
245+
bold: richtext.annotations.bold ?? '',
246+
italic: richtext.annotations.italic ?? '',
247+
strikethrough: richtext.annotations.strikethrough ?? '',
248+
underline: richtext.annotations.underline ?? '',
249+
code: richtext.annotations.code ?? '',
250+
color: richtext.annotations.color ?? '',
251+
},
252+
plain_text: richtext.plain_text,
253+
href: richtext.href,
254+
},
255+
],
256+
children: [],
244257
}));
245258
}
246259

integrations/documentation/notion/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,10 +1109,10 @@
11091109
"@nodelib/fs.scandir" "2.1.5"
11101110
fastq "^1.6.0"
11111111

1112-
"@poozle/engine-idk@^0.1.23":
1113-
version "0.1.23"
1114-
resolved "https://registry.yarnpkg.com/@poozle/engine-idk/-/engine-idk-0.1.23.tgz#aa60e925df06f08b35874a69cfb94ced3df99f8b"
1115-
integrity sha512-DVLYwiEqdBGJbMtFC89AZjr8RQZcREt+Uhinf2kF96oIJuzblprhZ6kVBuGMlUHFWwqWEFNfkFXnOSL3y9mOig==
1112+
"@poozle/engine-idk@^0.1.24":
1113+
version "0.1.24"
1114+
resolved "https://registry.yarnpkg.com/@poozle/engine-idk/-/engine-idk-0.1.24.tgz#9dce7e45d16cbbf8bf8e2b42225872c0aa59d13d"
1115+
integrity sha512-yO4JS+zcQj/v9nvF3FriZGTdeQytcqAQQXF/Qd+dx9QtCah2SoBD93zy2pYtpoXPCZuw1z2WPQWcxhsyom5BDA==
11161116
dependencies:
11171117
axios "^1.3.2"
11181118
qs "^6.11.2"

0 commit comments

Comments
 (0)