Skip to content

Commit

Permalink
Update api-endpoints.ts with types for new DB timestamp filter (maken…
Browse files Browse the repository at this point in the history
wcauchois authored Mar 17, 2022
1 parent b567af1 commit 20a7ba7
Showing 1 changed file with 131 additions and 17 deletions.
148 changes: 131 additions & 17 deletions src/api-endpoints.ts
Original file line number Diff line number Diff line change
@@ -8434,6 +8434,18 @@ type PropertyFilter =
}
| { formula: FormulaPropertyFilter; property: string; type?: "formula" }
| { rollup: RollupPropertyFilter; property: string; type?: "rollup" }

type TimestampCreatedTimeFilter = {
created_time: DatePropertyFilter
timestamp: "created_time"
type?: "created_time"
}

type TimestampLastEditedTimeFilter = {
last_edited_time: DatePropertyFilter
timestamp: "last_edited_time"
type?: "last_edited_time"
}
export type GetSelfParameters = Record<string, never>

export type GetSelfResponse = UserObjectResponse
@@ -9287,26 +9299,39 @@ export type GetPagePropertyParameters = GetPagePropertyPathParameters &
GetPagePropertyQueryParameters

export type GetPagePropertyResponse =
| { type: "number"; number: number | null; object: "property_item" }
| { type: "url"; url: string | null; object: "property_item" }
| {
type: "number"
number: number | null
object: "property_item"
id: string
}
| { type: "url"; url: string | null; object: "property_item"; id: string }
| {
type: "select"
select: SelectPropertyResponse | null
object: "property_item"
id: string
}
| {
type: "multi_select"
multi_select: Array<SelectPropertyResponse>
object: "property_item"
id: string
}
| {
type: "date"
date: DateResponse | null
object: "property_item"
id: string
}
| { type: "date"; date: DateResponse | null; object: "property_item" }
| { type: "email"; email: string | null; object: "property_item" }
| { type: "email"; email: string | null; object: "property_item"; id: string }
| {
type: "phone_number"
phone_number: string | null
object: "property_item"
id: string
}
| { type: "checkbox"; checkbox: boolean; object: "property_item" }
| { type: "checkbox"; checkbox: boolean; object: "property_item"; id: string }
| {
type: "files"
files: Array<
@@ -9322,22 +9347,31 @@ export type GetPagePropertyResponse =
}
>
object: "property_item"
id: string
}
| {
type: "created_by"
created_by: PartialUserObjectResponse
object: "property_item"
id: string
}
| {
type: "created_time"
created_time: string
object: "property_item"
id: string
}
| { type: "created_time"; created_time: string; object: "property_item" }
| {
type: "last_edited_by"
last_edited_by: PartialUserObjectResponse
object: "property_item"
id: string
}
| {
type: "last_edited_time"
last_edited_time: string
object: "property_item"
id: string
}
| {
type: "formula"
@@ -9347,19 +9381,32 @@ export type GetPagePropertyResponse =
| { type: "number"; number: number | null }
| { type: "boolean"; boolean: boolean | null }
object: "property_item"
id: string
}
| {
type: "title"
title: RichTextItemResponse
object: "property_item"
id: string
}
| { type: "title"; title: RichTextItemResponse; object: "property_item" }
| {
type: "rich_text"
rich_text: RichTextItemResponse
object: "property_item"
id: string
}
| {
type: "people"
people: PartialUserObjectResponse
object: "property_item"
id: string
}
| {
type: "relation"
relation: { id: string }
object: "property_item"
id: string
}
| { type: "relation"; relation: { id: string }; object: "property_item" }
| {
type: "rollup"
rollup:
@@ -9377,14 +9424,35 @@ export type GetPagePropertyResponse =
function: RollupFunction
}
object: "property_item"
id: string
}
| {
type: "property_item"
property_item:
| { type: "title"; title: EmptyObject; next_url: string | null }
| { type: "rich_text"; rich_text: EmptyObject; next_url: string | null }
| { type: "people"; people: EmptyObject; next_url: string | null }
| { type: "relation"; relation: EmptyObject; next_url: string | null }
| {
type: "title"
title: EmptyObject
next_url: string | null
id: string
}
| {
type: "rich_text"
rich_text: EmptyObject
next_url: string | null
id: string
}
| {
type: "people"
people: EmptyObject
next_url: string | null
id: string
}
| {
type: "relation"
relation: EmptyObject
next_url: string | null
id: string
}
| {
type: "rollup"
rollup:
@@ -9414,31 +9482,60 @@ export type GetPagePropertyResponse =
function: RollupFunction
}
next_url: string | null
id: string
}
object: "list"
next_cursor: string | null
has_more: boolean
results: Array<
| { type: "number"; number: number | null; object: "property_item" }
| { type: "url"; url: string | null; object: "property_item" }
| {
type: "number"
number: number | null
object: "property_item"
id: string
}
| {
type: "url"
url: string | null
object: "property_item"
id: string
}
| {
type: "select"
select: SelectPropertyResponse | null
object: "property_item"
id: string
}
| {
type: "multi_select"
multi_select: Array<SelectPropertyResponse>
object: "property_item"
id: string
}
| {
type: "date"
date: DateResponse | null
object: "property_item"
id: string
}
| {
type: "email"
email: string | null
object: "property_item"
id: string
}
| { type: "date"; date: DateResponse | null; object: "property_item" }
| { type: "email"; email: string | null; object: "property_item" }
| {
type: "phone_number"
phone_number: string | null
object: "property_item"
id: string
}
| {
type: "checkbox"
checkbox: boolean
object: "property_item"
id: string
}
| { type: "checkbox"; checkbox: boolean; object: "property_item" }
| {
type: "files"
files: Array<
@@ -9454,26 +9551,31 @@ export type GetPagePropertyResponse =
}
>
object: "property_item"
id: string
}
| {
type: "created_by"
created_by: PartialUserObjectResponse
object: "property_item"
id: string
}
| {
type: "created_time"
created_time: string
object: "property_item"
id: string
}
| {
type: "last_edited_by"
last_edited_by: PartialUserObjectResponse
object: "property_item"
id: string
}
| {
type: "last_edited_time"
last_edited_time: string
object: "property_item"
id: string
}
| {
type: "formula"
@@ -9483,26 +9585,31 @@ export type GetPagePropertyResponse =
| { type: "number"; number: number | null }
| { type: "boolean"; boolean: boolean | null }
object: "property_item"
id: string
}
| {
type: "title"
title: RichTextItemResponse
object: "property_item"
id: string
}
| {
type: "rich_text"
rich_text: RichTextItemResponse
object: "property_item"
id: string
}
| {
type: "people"
people: PartialUserObjectResponse
object: "property_item"
id: string
}
| {
type: "relation"
relation: { id: string }
object: "property_item"
id: string
}
| {
type: "rollup"
@@ -9533,6 +9640,7 @@ export type GetPagePropertyResponse =
function: RollupFunction
}
object: "property_item"
id: string
}
>
}
@@ -10485,18 +10593,24 @@ type QueryDatabaseBodyParameters = {
| {
or: Array<
| PropertyFilter
| TimestampCreatedTimeFilter
| TimestampLastEditedTimeFilter
| { or: Array<PropertyFilter> }
| { and: Array<PropertyFilter> }
>
}
| {
and: Array<
| PropertyFilter
| TimestampCreatedTimeFilter
| TimestampLastEditedTimeFilter
| { or: Array<PropertyFilter> }
| { and: Array<PropertyFilter> }
>
}
| PropertyFilter
| TimestampCreatedTimeFilter
| TimestampLastEditedTimeFilter
start_cursor?: string
page_size?: number
archived?: boolean

0 comments on commit 20a7ba7

Please sign in to comment.