aboutsummaryrefslogtreecommitdiff
path: root/src/models/tests
diff options
context:
space:
mode:
authorGravatar Jake Swenson <jake@jakeswenson.com> 2021-08-29 12:59:04 -0700
committerGravatar Jake Swenson <jake@jakeswenson.com> 2021-08-29 12:59:04 -0700
commit1c22088640e5deeadd61017bd90920b652685b5f (patch)
tree59d110a7c8792c39e0c1ea180fa972eee1c4662d /src/models/tests
parent8d5779a661f4537ef7d87a44bdfbf240eb054ff1 (diff)
downloadnotion-1c22088640e5deeadd61017bd90920b652685b5f.tar.gz
notion-1c22088640e5deeadd61017bd90920b652685b5f.tar.zst
notion-1c22088640e5deeadd61017bd90920b652685b5f.zip
Notion API Version 2021-08-16 support; fix a bunch of modling errors as well
Diffstat (limited to 'src/models/tests')
-rw-r--r--src/models/tests/error.json6
-rw-r--r--src/models/tests/search_results.json209
-rw-r--r--src/models/tests/unknown_error.json6
3 files changed, 221 insertions, 0 deletions
diff --git a/src/models/tests/error.json b/src/models/tests/error.json
new file mode 100644
index 0000000..0194824
--- /dev/null
+++ b/src/models/tests/error.json
@@ -0,0 +1,6 @@
+{
+ "object": "error",
+ "status": 400,
+ "code": "validation_error",
+ "message": "Could not find property with name or id: LastEditedTime"
+}
diff --git a/src/models/tests/search_results.json b/src/models/tests/search_results.json
new file mode 100644
index 0000000..ddeb27f
--- /dev/null
+++ b/src/models/tests/search_results.json
@@ -0,0 +1,209 @@
+{
+ "object": "list",
+ "results": [
+ {
+ "object": "database",
+ "id": "58",
+ "cover": null,
+ "icon": {
+ "type": "emoji",
+ "emoji": "✈️"
+ },
+ "created_time": "2019-05-18T20:28:00.000Z",
+ "last_edited_time": "2021-08-29T16:13:00.000Z",
+ "title": [
+ {
+ "type": "text",
+ "text": {
+ "content": "Plans",
+ "link": null
+ },
+ "annotations": {
+ "bold": false,
+ "italic": false,
+ "strikethrough": false,
+ "underline": false,
+ "code": false,
+ "color": "default"
+ },
+ "plain_text": "Plans",
+ "href": null
+ }
+ ],
+ "properties": {
+ "Places": {
+ "id": "6B",
+ "name": "Places",
+ "type": "rich_text",
+ "rich_text": {}
+ },
+ "End Date": {
+ "id": "7*",
+ "name": "End Date",
+ "type": "formula",
+ "formula": {
+ "expression": "dateSubtract(end(prop(\"Date\")), hour(end(prop(\"Date\"))) * 60 + minute(end(prop(\"Date\"))), \"minutes\")"
+ }
+ },
+ "Type": {
+ "id": "%3D",
+ "name": "Type",
+ "type": "select",
+ "select": {
+ "options": [
+ {
+ "id": "f9",
+ "name": "Travel",
+ "color": "green"
+ },
+ {
+ "id": "0b",
+ "name": "Event",
+ "color": "pink"
+ }
+ ]
+ }
+ },
+ "People": {
+ "id": "G'",
+ "name": "People",
+ "type": "people",
+ "people": {}
+ },
+ "Date": {
+ "id": "VX",
+ "name": "Date",
+ "type": "date",
+ "date": {}
+ },
+ "Last Edited": {
+ "id": "ow",
+ "name": "Last Edited",
+ "type": "last_edited_time",
+ "last_edited_time": {}
+ },
+ "Status": {
+ "id": "uX",
+ "name": "Status",
+ "type": "select",
+ "select": {
+ "options": [
+ {
+ "id": "e4",
+ "name": "Time Block",
+ "color": "pink"
+ },
+ {
+ "id": "27",
+ "name": "Idea",
+ "color": "purple"
+ },
+ {
+ "id": "86",
+ "name": "Planning",
+ "color": "blue"
+ },
+ {
+ "id": "fb",
+ "name": "Booked",
+ "color": "green"
+ },
+ {
+ "id": "9c",
+ "name": "Reserved",
+ "color": "green"
+ },
+ {
+ "id": "49",
+ "name": "Need Flights",
+ "color": "red"
+ },
+ {
+ "id": "23",
+ "name": "Need Reservation",
+ "color": "red"
+ },
+ {
+ "id": "2c",
+ "name": "Need Tickets",
+ "color": "red"
+ },
+ {
+ "id": "69",
+ "name": "Need Hotel",
+ "color": "red"
+ },
+ {
+ "id": "73",
+ "name": "Canceled",
+ "color": "red"
+ }
+ ]
+ }
+ },
+ "Nights": {
+ "id": "%7",
+ "name": "Nights",
+ "type": "formula",
+ "formula": {
+ "expression": "dateBetween(end(prop(\"Date\")), start(prop(\"Date\")), \"days\")"
+ }
+ },
+ "Name": {
+ "id": "title",
+ "name": "Name",
+ "type": "title",
+ "title": {}
+ }
+ },
+ "parent": {
+ "type": "page_id",
+ "page_id": "12"
+ }
+ },
+ {
+ "object": "page",
+ "id": "71",
+ "created_time": "2021-05-22T22:38:00.000Z",
+ "last_edited_time": "2021-05-31T17:09:00.000Z",
+ "cover": null,
+ "icon": {
+ "type": "emoji",
+ "emoji": "🎢"
+ },
+ "parent": {
+ "type": "page_id",
+ "page_id": "7c"
+ },
+ "archived": false,
+ "properties": {
+ "title": {
+ "id": "title",
+ "type": "title",
+ "title": [
+ {
+ "type": "text",
+ "text": {
+ "content": "Plans",
+ "link": null
+ },
+ "annotations": {
+ "bold": false,
+ "italic": false,
+ "strikethrough": false,
+ "underline": false,
+ "code": false,
+ "color": "default"
+ },
+ "plain_text": "Plans",
+ "href": null
+ }
+ ]
+ }
+ },
+ "url": "https://www.notion.so/Plans"
+ }
+ ],
+ "next_cursor": null,
+ "has_more": false
+}
diff --git a/src/models/tests/unknown_error.json b/src/models/tests/unknown_error.json
new file mode 100644
index 0000000..0e30fea
--- /dev/null
+++ b/src/models/tests/unknown_error.json
@@ -0,0 +1,6 @@
+{
+ "object": "error",
+ "status": 400,
+ "code": "asadfsdfasd",
+ "message": "I made this up"
+}