View
Defined in: src/models/view.model.ts:19
View model class with helper methods.
A view controls how a database or data source shows its rows, for example as a table, board, or calendar.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new View(
data):View
Defined in: src/models/view.model.ts:20
Parameters
Section titled “Parameters”configuration?
Section titled “configuration?”{[key: string]: unknown; type: "map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard"; } = ...
configuration.type
Section titled “configuration.type”"map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard" = ...
created_by
Section titled “created_by”{ avatar_url?: string | null; id: string; name?: string; object: "user"; person: { email: string; email_verified?: boolean; }; type: "person"; } | { avatar_url?: string | null; bot: { owner: { type: "workspace"; workspace: true; } | { type: "user"; }; workspace_id?: string; workspace_limits?: { max_file_upload_size_in_bytes: number; }; workspace_name?: string | null; }; id: string; name?: string; object: "user"; type: "bot"; } | { id: string; object: "user"; } = userSchema
created_time
Section titled “created_time”string = notionDateStringSchema
dashboard_view_id?
Section titled “dashboard_view_id?”string = ...
data_source_id
Section titled “data_source_id”string | null = ...
filter?
Section titled “filter?”Record<string, unknown> | null = ...
string = ...
last_edited_by
Section titled “last_edited_by”{ avatar_url?: string | null; id: string; name?: string; object: "user"; person: { email: string; email_verified?: boolean; }; type: "person"; } | { avatar_url?: string | null; bot: { owner: { type: "workspace"; workspace: true; } | { type: "user"; }; workspace_id?: string; workspace_limits?: { max_file_upload_size_in_bytes: number; }; workspace_name?: string | null; }; id: string; name?: string; object: "user"; type: "bot"; } | { id: string; object: "user"; } = userSchema
last_edited_time
Section titled “last_edited_time”string = notionDateStringSchema
string = ...
object
Section titled “object”"view" = ...
parent
Section titled “parent”{ database_id: string; type: "database_id"; } = databaseParentSchema
parent.database_id
Section titled “parent.database_id”string = ...
parent.type
Section titled “parent.type”"database_id" = ...
quick_filters?
Section titled “quick_filters?”Record<string, unknown> | null = ...
sorts?
Section titled “sorts?”Record<string, unknown>[] | null = ...
"map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard" = ...
string = ...
Returns
Section titled “Returns”View
Overrides
Section titled “Overrides”BaseModel<NotionView>.constructor
Accessors
Section titled “Accessors”configuration
Section titled “configuration”Get Signature
Section titled “Get Signature”get configuration(): {[
key:string]:unknown;type:"map"|"table"|"list"|"board"|"calendar"|"timeline"|"gallery"|"form"|"chart"|"dashboard"; } |undefined
Defined in: src/models/view.model.ts:90
Returns the view’s per-layout configuration, if any.
Returns
Section titled “Returns”{[key: string]: unknown; type: "map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard"; } | undefined
createdBy
Section titled “createdBy”Get Signature
Section titled “Get Signature”get createdBy(): {
avatar_url?:string|null;id:string;name?:string;object:"user";person: {string;email_verified?:boolean; };type:"person"; } | {avatar_url?:string|null;bot: {owner: {type:"workspace";workspace:true; } | {type:"user"; };workspace_id?:string;workspace_limits?: {max_file_upload_size_in_bytes:number; };workspace_name?:string|null; };id:string;name?:string;object:"user";type:"bot"; } | {id:string;object:"user"; }
Defined in: src/models/view.model.ts:111
Returns the user who created the view.
Returns
Section titled “Returns”{ avatar_url?: string | null; id: string; name?: string; object: "user"; person: { email: string; email_verified?: boolean; }; type: "person"; } | { avatar_url?: string | null; bot: { owner: { type: "workspace"; workspace: true; } | { type: "user"; }; workspace_id?: string; workspace_limits?: { max_file_upload_size_in_bytes: number; }; workspace_name?: string | null; }; id: string; name?: string; object: "user"; type: "bot"; } | { id: string; object: "user"; }
createdTime
Section titled “createdTime”Get Signature
Section titled “Get Signature”get createdTime():
Date
Defined in: src/models/view.model.ts:97
Returns the created time as a Date object.
Returns
Section titled “Returns”Date
dashboardViewId
Section titled “dashboardViewId”Get Signature
Section titled “Get Signature”get dashboardViewId():
string|undefined
Defined in: src/models/view.model.ts:132
Returns the widget ID, if a dashboard shows this view as a widget.
Returns
Section titled “Returns”string | undefined
dataSourceId
Section titled “dataSourceId”Get Signature
Section titled “Get Signature”get dataSourceId():
string|null
Defined in: src/models/view.model.ts:48
Returns the data source ID this view belongs to, or null for dashboard views.
Returns
Section titled “Returns”string | null
filter
Section titled “filter”Get Signature
Section titled “Get Signature”get filter():
Record<string,unknown> |null|undefined
Defined in: src/models/view.model.ts:69
Returns the view’s filter, if any.
Returns
Section titled “Returns”Record<string, unknown> | null | undefined
Get Signature
Section titled “Get Signature”get id():
string
Defined in: src/models/view.model.ts:34
Returns the view ID.
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”lastEditedBy
Section titled “lastEditedBy”Get Signature
Section titled “Get Signature”get lastEditedBy(): {
avatar_url?:string|null;id:string;name?:string;object:"user";person: {string;email_verified?:boolean; };type:"person"; } | {avatar_url?:string|null;bot: {owner: {type:"workspace";workspace:true; } | {type:"user"; };workspace_id?:string;workspace_limits?: {max_file_upload_size_in_bytes:number; };workspace_name?:string|null; };id:string;name?:string;object:"user";type:"bot"; } | {id:string;object:"user"; }
Defined in: src/models/view.model.ts:118
Returns the user who last edited the view.
Returns
Section titled “Returns”{ avatar_url?: string | null; id: string; name?: string; object: "user"; person: { email: string; email_verified?: boolean; }; type: "person"; } | { avatar_url?: string | null; bot: { owner: { type: "workspace"; workspace: true; } | { type: "user"; }; workspace_id?: string; workspace_limits?: { max_file_upload_size_in_bytes: number; }; workspace_name?: string | null; }; id: string; name?: string; object: "user"; type: "bot"; } | { id: string; object: "user"; }
lastEditedTime
Section titled “lastEditedTime”Get Signature
Section titled “Get Signature”get lastEditedTime():
Date
Defined in: src/models/view.model.ts:104
Returns the last edited time as a Date object.
Returns
Section titled “Returns”Date
Get Signature
Section titled “Get Signature”get name():
string
Defined in: src/models/view.model.ts:55
Returns the view name.
Returns
Section titled “Returns”string
object
Section titled “object”Get Signature
Section titled “Get Signature”get object():
"view"
Defined in: src/models/view.model.ts:27
Returns “view” - the object type.
Returns
Section titled “Returns”"view"
Overrides
Section titled “Overrides”parent
Section titled “parent”Get Signature
Section titled “Get Signature”get parent(): {
database_id:string;type:"database_id"; } | {data_source_id:string;database_id:string;type:"data_source_id"; } | {page_id:string;type:"page_id"; } | {type:"workspace";workspace:true; } | {block_id:string;type:"block_id"; } | {agent_id:string;type:"agent_id"; }
Defined in: src/models/view.model.ts:41
Returns the parent object (database reference).
Returns
Section titled “Returns”{ database_id: string; type: "database_id"; } | { data_source_id: string; database_id: string; type: "data_source_id"; } | { page_id: string; type: "page_id"; } | { type: "workspace"; workspace: true; } | { block_id: string; type: "block_id"; } | { agent_id: string; type: "agent_id"; }
quickFilters
Section titled “quickFilters”Get Signature
Section titled “Get Signature”get quickFilters():
Record<string,unknown> |null|undefined
Defined in: src/models/view.model.ts:83
Returns the view’s quick filters, if any.
Returns
Section titled “Returns”Record<string, unknown> | null | undefined
Get Signature
Section titled “Get Signature”get sorts():
Record<string,unknown>[] |null|undefined
Defined in: src/models/view.model.ts:76
Returns the view’s sorts, if any.
Returns
Section titled “Returns”Record<string, unknown>[] | null | undefined
Get Signature
Section titled “Get Signature”get type():
"map"|"table"|"list"|"board"|"calendar"|"timeline"|"gallery"|"form"|"chart"|"dashboard"
Defined in: src/models/view.model.ts:62
Returns the view type, for example table, board, or calendar.
Returns
Section titled “Returns”"map" | "table" | "list" | "board" | "calendar" | "timeline" | "gallery" | "form" | "chart" | "dashboard"
Get Signature
Section titled “Get Signature”get url():
string
Defined in: src/models/view.model.ts:125
Returns the Notion URL of the view.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”isWidgetView()
Section titled “isWidgetView()”isWidgetView():
boolean
Defined in: src/models/view.model.ts:139
Returns whether a dashboard shows this view as a widget.
Returns
Section titled “Returns”boolean
toJSON()
Section titled “toJSON()”toJSON():
object
Defined in: src/models/base.model.ts:20
Returns the raw validated data as a plain object.
Returns
Section titled “Returns”object
configuration?
Section titled “configuration?”
optionalconfiguration?:object
Index Signature
Section titled “Index Signature”[key: string]: unknown
configuration.type
Section titled “configuration.type”type:
"map"|"table"|"list"|"board"|"calendar"|"timeline"|"gallery"|"form"|"chart"|"dashboard"
created_by
Section titled “created_by”created_by: {
avatar_url?:string|null;id:string;name?:string;object:"user";person: {string;email_verified?:boolean; };type:"person"; } | {avatar_url?:string|null;bot: {owner: {type:"workspace";workspace:true; } | {type:"user"; };workspace_id?:string;workspace_limits?: {max_file_upload_size_in_bytes:number; };workspace_name?:string|null; };id:string;name?:string;object:"user";type:"bot"; } | {id:string;object:"user"; } =userSchema
created_time
Section titled “created_time”created_time:
string=notionDateStringSchema
dashboard_view_id?
Section titled “dashboard_view_id?”
optionaldashboard_view_id?:string
data_source_id
Section titled “data_source_id”data_source_id:
string|null
filter?
Section titled “filter?”
optionalfilter?:Record<string,unknown> |null
id:
string
last_edited_by
Section titled “last_edited_by”last_edited_by: {
avatar_url?:string|null;id:string;name?:string;object:"user";person: {string;email_verified?:boolean; };type:"person"; } | {avatar_url?:string|null;bot: {owner: {type:"workspace";workspace:true; } | {type:"user"; };workspace_id?:string;workspace_limits?: {max_file_upload_size_in_bytes:number; };workspace_name?:string|null; };id:string;name?:string;object:"user";type:"bot"; } | {id:string;object:"user"; } =userSchema
last_edited_time
Section titled “last_edited_time”last_edited_time:
string=notionDateStringSchema
name:
string
object
Section titled “object”object:
"view"
parent
Section titled “parent”parent:
object=databaseParentSchema
parent.database_id
Section titled “parent.database_id”database_id:
string
parent.type
Section titled “parent.type”type:
"database_id"
quick_filters?
Section titled “quick_filters?”
optionalquick_filters?:Record<string,unknown> |null
sorts?
Section titled “sorts?”
optionalsorts?:Record<string,unknown>[] |null
type:
"map"|"table"|"list"|"board"|"calendar"|"timeline"|"gallery"|"form"|"chart"|"dashboard"
url:
string