Comparing version 0.5.0 to 0.5.1
@@ -0,0 +0,0 @@ { |
{ | ||
"name": "notabase", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "API Wrapper For Notion's Database", | ||
@@ -5,0 +5,0 @@ "main": "src/notabase.js", |
@@ -17,4 +17,24 @@ # Notabase (WIP) | ||
import Notabase from 'notabase' | ||
// node env | ||
// just Read public data | ||
let nb = new Notabase() | ||
// CRUD support | ||
let nb = new Notabase({ | ||
token: <token_v2> | ||
}) | ||
// browser env | ||
// without authCode Read public data | ||
// with authCode CRUD support | ||
let nb = new Notabase({ | ||
proxy: { | ||
url: <cloudflare worker url>, | ||
authCode: <> | ||
} | ||
}) | ||
// get my music data | ||
@@ -21,0 +41,0 @@ let db = await nb.fetch({ |
@@ -0,0 +0,0 @@ const token_v2 = undefined |
@@ -150,2 +150,3 @@ const NOTION_BASE_URL = "https://www.notion.so" | ||
collectionSchemaStore[collectionId] = schema | ||
blockStore = { ...blockStore, ...data.recordMap.block } | ||
return new Collection(collectionId, collectionViewId, data) | ||
@@ -211,5 +212,4 @@ } | ||
}) | ||
// 缓存 | ||
blockStore = { ...blockStore, ...rawData.recordMap.block } | ||
// blockStore = { ...blockStore, ...rawData.recordMap.block } | ||
} | ||
@@ -220,4 +220,11 @@ | ||
makeRow(rowBlockId, schema) { | ||
let rowData = blockStore[rowBlockId].value | ||
let rowData | ||
try { | ||
rowData = blockStore[rowBlockId].value | ||
} catch (err) { | ||
console.log(blockStore, rowBlockId) | ||
} | ||
let props = Object.entries(schema).map(item => { | ||
@@ -224,0 +231,0 @@ let [key, v] = item |
@@ -0,0 +0,0 @@ const Notabase = require('./src/notabase') |
Sorry, the diff of this file is not supported yet
21152
392
68