Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notabase

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notabase - npm Package Compare versions

Comparing version 0.8.5 to 0.8.6

2

package.json
{
"name": "notabase",
"version": "0.8.5",
"version": "0.8.6",
"description": "API Wrapper For Notion's Database",

@@ -5,0 +5,0 @@ "main": "src/notabase.js",

@@ -90,3 +90,3 @@ const Collection = require('./collection')

let requestsIds = [...blockIds.map(item => ({ "table": "block", "id": item })), ...collectionIds.map(item => ({ "table": "collection", "id": item }))]
requestsIds.length > 10 ?console.log(`>>>> getRecordValues: ${requestsIds.length}`): console.log(`>>>> getRecordValues:${requestsIds}`)
requestsIds.length > 10 ? console.log(`>>>> getRecordValues: ${requestsIds.length}`) : console.log(`>>>> getRecordValues:${requestsIds}`)
let data = await this.reqeust.post(`/api/v3/getRecordValues`,

@@ -114,17 +114,17 @@ {

async queryCollection(collectionId, collectionViewId, limit=980) {
return await this.reqeust.post(`/api/v3/queryCollection`, {
collectionId,
collectionViewId,
loader: {
"type": "table",
"limit": limit,
"userTimeZone": "Asia/Shanghai",
"userLocale": "zh-tw",
"loadContentCover": true
}
})
async queryCollection(collectionId, collectionViewId, limit = 980) {
return await this.reqeust.post(`/api/v3/queryCollection`, {
collectionId,
collectionViewId,
loader: {
"type": "table",
"limit": limit,
"userTimeZone": "Asia/Shanghai",
"userLocale": "zh-tw",
"loadContentCover": true
}
})
}
async fetchCollectionData(collectionId, collectionViewId, limit=980) {
async fetchCollectionData(collectionId, collectionViewId, limit = 980) {
let data = await this.queryCollection(collectionId, collectionViewId, limit);

@@ -147,22 +147,13 @@ console.log(`>>>> queryCollection:${collectionId}`)

// pageId with '-' split
pageId = getBlockHashId(urlOrPageId)
if (pageId && pageId in this.collectionStore) {
return this.collectionStore[pageId]
} else {
[collectionId, collectionViewId] = await this.getPageCollectionInfo(getBlockHashId(urlOrPageId))
}
// pageId = getBlockHashId(urlOrPageId)
[collectionId, collectionViewId] = await this.getPageCollectionInfo(getBlockHashId(urlOrPageId))
} else if (urlOrPageId.startsWith("http")) {
// url
pageId = getUrlPageId(urlOrPageId)
if (pageId && pageId in this.collectionStore) {
return this.collectionStore[pageId]
} else {
let [base, params] = urlOrPageId.split('?')
let baseUrlList = base.split('/'); // 这里需要添加分号,否则编译出错。 参见 https://www.zhihu.com/question/20298345/answer/49551142
[collectionId, collectionViewId] = await this.getPageCollectionInfo(baseUrlList[baseUrlList.length - 1])
}
// pageId = getUrlPageId(urlOrPageId)
let [base, params] = urlOrPageId.split('?')
let baseUrlList = base.split('/'); // 这里需要添加分号,否则编译出错。 参见 https://www.zhihu.com/question/20298345/answer/49551142
[collectionId, collectionViewId] = await this.getPageCollectionInfo(baseUrlList[baseUrlList.length - 1])
}
let r = await this.fetchCollectionData(collectionId, collectionViewId)
this.collectionStore[pageId] = r
// this.collectionStore[pageId] = r
return r

@@ -169,0 +160,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc