跳至正文
Wener Notes

Notion

约 2 分钟阅读

数据模型

json
{
  "id": "abcd",
  "type": "to_do",
  "properties": {
    "title": [[""]],
    "checked": [["No"]]
  },
  "content": ["defgh"],
  "format": {
    "page_icon": "📺",
    "block_color": "orange_background"
  },
  "parent": "01234",
  // database schema
  "schema": {
    "abc": {
      "name": "Date",
      "type": "date"
    }
  },
  "query": {
    "calendar_by": "abc",
    "sort": {},
    "filter": {}
  }
}

API

Filter

FilterObject in Notion JSON
{
  "filters": [
    {
      "filter": {
        "value": {
          "type": "exact",
          "value": false
        },
        "operator": "checkbox_is"
      },
      "property": "eP[*"
    },
    {
      "filter": {
        "value": {
          "type": "exact",
          "value": "even"
        },
        "operator": "enum_contains"
      },
      "property": "<r1@"
    }
  ],
  "operator": "or"
}
FilterObject in API
export interface FilterObject {
  property: string;
  text: {
    equals: string;
    does_not_equal: string;
    contains: string;
    does_not_contain: string;
    starts_with: string;
    ends_with: string;
    is_empty: boolean;
    is_not_empty: boolean;
  };
  number: {
    equals: number;
    does_not_equal: number;
    greater_than: number;
    less_than: number;
    greater_than_or_equal_to: number;
    less_than_or_equal_to: number;
    is_empty: boolean;
    is_not_empty: boolean;
  };

  checkbox: {
    equals: boolean;
    does_not_equal: boolean;
  };
  select: {
    equals: string;
    does_not_equal: string;
    is_empty: boolean;
    is_not_empty: boolean;
  };
  multi_select: {
    equals: string;
    does_not_equal: string;

    is_empty: boolean;
    is_not_empty: boolean;
  };

  date: {
    equals: string;
    before: string;
    after: string;
    on_or_before: string;
    on_or_after: string;
    past_week: object;
    past_month: object;
    past_year: object;
    next_week: object;
    next_month: object;
    next_year: object;

    is_empty: boolean;
    is_not_empty: boolean;
  };

  people: {
    contains: string;
    does_not_contain: string;
    is_empty: boolean;
    is_not_empty: boolean;
  };
  file: {
    is_empty: boolean;
    is_not_empty: boolean;
  };
  relation: {
    contains: string;
    does_not_contain: string;
    is_empty: boolean;
    is_not_empty: boolean;
  };
  formula: {
    text: object;
    checkbox: object;
    number: object;
    date: object;
  };
  or: [];
  any: [];
}

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub15 条
Hacker News1 条
其他外链11 条
最近更新commit 861e955编辑