New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

notion-client

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notion-client - npm Package Compare versions

Comparing version 0.4.0 to 1.0.0

fixtures/blocks/equation.json

14

build/notion-api.js

@@ -56,5 +56,6 @@ "use strict";

const pendingBlocks = Object.keys(recordMap.block).flatMap((blockId) => {
var _a, _b;
const block = recordMap.block[blockId];
const content = block.value && block.value.content;
return content && block.value.type !== 'page'
const content = (_a = block.value) === null || _a === void 0 ? void 0 : _a.content;
return content && ((_b = block.value) === null || _b === void 0 ? void 0 : _b.type) !== 'page'
? content.filter((id) => !recordMap.block[id])

@@ -77,3 +78,3 @@ : [];

const block = recordMap.block[blockId].value;
if (block.type === 'collection_view') {
if ((block === null || block === void 0 ? void 0 : block.type) === 'collection_view') {
return block.view_ids.map((collectionViewId) => ({

@@ -115,5 +116,6 @@ collectionId: block.collection_id,

const block = recordMap.block[blockId].value;
if (block.type === 'pdf' ||
block.type === 'audio' ||
block.type === 'file') {
if (block &&
(block.type === 'pdf' ||
block.type === 'audio' ||
block.type === 'file')) {
const source = (_c = (_b = (_a = block.properties) === null || _a === void 0 ? void 0 : _a.source) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[0];

@@ -120,0 +122,0 @@ if (source) {

{
"name": "notion-client",
"version": "0.4.0",
"description": "TypeScript client for the unofficial Notion API.",
"version": "1.0.0",
"description": "Robust TypeScript client for the unofficial Notion API.",
"repository": "saasify-sh/notion",

@@ -18,4 +18,4 @@ "author": "Saasify <dev@saasify.sh>",

"got": "^11.5.2",
"notion-types": "^0.4.0",
"notion-utils": "^0.4.0",
"notion-types": "^1.0.0",
"notion-utils": "^1.0.0",
"p-map": "^4.0.0"

@@ -26,3 +26,3 @@ },

},
"gitHead": "76f2886c3a82acae47ac440ea859328fc5821e1e"
"gitHead": "3b23749ac247ac84f50d5db4952f244228e15b48"
}

@@ -7,3 +7,3 @@ <p align="center">

> TypeScript client for the unofficial Notion API.
> Robust TypeScript client for the unofficial Notion API.

@@ -25,9 +25,9 @@ [![NPM](https://img.shields.io/npm/v/notion-client.svg)](https://www.npmjs.com/package/notion-client) [![Build Status](https://travis-ci.com/saasify-sh/notion.svg?branch=master)](https://travis-ci.com/saasify-sh/notion) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)

// you can optionally pass an authToken to access private notion resources
const api = new NotionAPI()
// this will fetch all blocks for the given page as well as any collection data
// for collection views contained on the page
// fetch a page's content, including all async blocks, collection queries, and signed urls
const page = await api.getPage('067dd719-a912-471e-a9a3-ac10710e7fdf')
// example of fetching the data for a specific collection instance
// fetch the data for a specific collection instance
const collectionId = '2d8aec23-8281-4a94-9090-caaf823dd21a'

@@ -34,0 +34,0 @@ const collectionViewId = 'ab639a5a-853e-45e1-9ef7-133b486c0acf'

@@ -65,5 +65,5 @@ import got from 'got'

const block = recordMap.block[blockId]
const content = block.value && block.value.content
const content = block.value?.content
return content && block.value.type !== 'page'
return content && block.value?.type !== 'page'
? content.filter((id) => !recordMap.block[id])

@@ -94,3 +94,3 @@ : []

if (block.type === 'collection_view') {
if (block?.type === 'collection_view') {
return block.view_ids.map((collectionViewId) => ({

@@ -165,5 +165,6 @@ collectionId: block.collection_id,

if (
block.type === 'pdf' ||
block.type === 'audio' ||
block.type === 'file'
block &&
(block.type === 'pdf' ||
block.type === 'audio' ||
block.type === 'file')
) {

@@ -170,0 +171,0 @@ const source = block.properties?.source?.[0]?.[0]

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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