@mountnotion/tools
TypeScript icon, indicating that this package has built-in type declarations

1.0.17 • Public • Published

@myth-software/tools

install

# npm
npm i -S @myth-software/tools

# yarn
yarn add @myth-software/tools

overview

summary
notion api responses are EXTREMELY deeply nested. tools provides simple flattening of notion responses and simple expansion of properties. beyond that, it exports a wrapper around the notion api for easy configuration.

example usage

import {
  flattenPageResponse,
  expandProperties,
  notion,
} from '@myth-software/tools';

const page = await notion.pages.retrieve({
  page_id,
});

const [person, PROPERTIES] = flattenPageResponse<People>(page);

const properties = expandProperties<People>(person, {
  properties: PROPERTIES,
});

const updatedPerson = await notion.pages.update(
  {
    page_id,
    properties,
  },
  { flattenResponse: true }
);

Readme

Keywords

none

Package Sidebar

Install

npm i @mountnotion/tools

Weekly Downloads

1

Version

1.0.17

License

unlicensed

Unpacked Size

217 kB

Total Files

359

Last publish

Collaborators

  • peterbsmyth