DataSource
Defined in: src/models/dataSource.model.ts:21
Data Source model class with helper methods.
Data sources are individual tables of data that live under a Notion database.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DataSource(
data):DataSource
Defined in: src/models/dataSource.model.ts:22
Parameters
Section titled “Parameters”{ file: { expiry_time: string; url: string; }; type: "file"; } | { file_upload: { id: string; }; type: "file_upload"; } | { external: { url: string; }; type: "external"; } | null = ...
Data source cover image
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
User who created the data source
created_time
Section titled “created_time”string = notionDateStringSchema
Creation date and time for this data source, in ISO 8601 format
database_parent
Section titled “database_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"; } = parentSchema
Information about the database’s parent (the data source’s grandparent)
description
Section titled “description”({ annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; plain_text: string; text: { content: string; link: { url: string; } | null; }; type: "text"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; mention: { database: { id: string; }; type: "database"; } | { date: { end: string | null; start: string; time_zone?: string | null; }; type: "date"; } | { link_preview: { url: string; }; type: "link_preview"; } | { page: { id: string; }; type: "page"; } | { template_mention: { template_mention_date: "today" | "now"; type: "template_mention_date"; } | { template_mention_user: "me"; type: "template_mention_user"; }; type: "template_mention"; } | { type: "user"; user: { 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: …; } | { type: …; }; workspace_id?: string; workspace_limits?: { max_file_upload_size_in_bytes: …; }; workspace_name?: string | null; }; id: string; name?: string; object: "user"; type: "bot"; } | { id: string; object: "user"; }; }; plain_text: string; type: "mention"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; equation: { expression: string; }; href: string | null; plain_text: string; type: "equation"; })[] = richTextSchema
Description of the data source as it appears in Notion
{ file: { expiry_time: string; url: string; }; type: "file"; } | { file_upload: { id: string; }; type: "file_upload"; } | { external: { url: string; }; type: "external"; } | { emoji: string; type: "emoji"; } | { icon: { color?: "blue" | "brown" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | "lightgray"; name: string; }; type: "icon"; } | { custom_emoji: { id: string; name?: string; url?: string; }; type: "custom_emoji"; } | null = ...
Data source icon (File, Emoji, Native Icon, or Custom Emoji object)
string = ...
Unique identifier for the data source
in_trash
Section titled “in_trash”boolean = ...
Whether the data source is in the trash
is_inline
Section titled “is_inline”boolean = ...
Whether the data source is inline
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
User who last edited the data source
last_edited_time
Section titled “last_edited_time”string = notionDateStringSchema
Last edited date and time for this data source, in ISO 8601 format
object
Section titled “object”"data_source" = ...
Always “data_source”
parent
Section titled “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"; } = parentSchema
Information about the data source’s parent database
properties
Section titled “properties”Record<string, { checkbox: Record<string, never>; description?: string; id: string; name: string; type: "checkbox"; } | { created_by: Record<string, never>; description?: string; id: string; name: string; type: "created_by"; } | { created_time: Record<string, never>; description?: string; id: string; name: string; type: "created_time"; } | { date: Record<string, never>; description?: string; id: string; name: string; type: "date"; } | { description?: string; email: Record<string, never>; id: string; name: string; type: "email"; } | { description?: string; files: Record<string, never>; id: string; name: string; type: "files"; } | { description?: string; formula: { expression: string; }; id: string; name: string; type: "formula"; } | { description?: string; id: string; last_edited_by: Record<string, never>; name: string; type: "last_edited_by"; } | { description?: string; id: string; last_edited_time: Record<string, never>; name: string; type: "last_edited_time"; } | { description?: string; id: string; multi_select: { options: object[]; }; name: string; type: "multi_select"; } | { description?: string; id: string; name: string; number: { format: "number" | "argentine_peso" | "baht" | "australian_dollar" | "canadian_dollar" | "chilean_peso" | "colombian_peso" | "danish_krone" | "dirham" | "dollar" | "euro" | "forint" | "franc" | "hong_kong_dollar" | "koruna" | "krona" | "leu" | "lira" | "mexican_peso" | "new_taiwan_dollar" | "new_zealand_dollar" | "norwegian_krone" | "number_with_commas" | "percent" | "philippine_peso" | "pound" | "peruvian_sol" | "rand" | "real" | "ringgit" | "riyal" | "ruble" | "rupee" | "rupiah" | "shekel" | "singapore_dollar" | "uruguayan_peso" | "yen" | "yuan" | "won" | "zloty"; }; type: "number"; } | { description?: string; id: string; name: string; people: Record<string, never>; type: "people"; } | { description?: string; id: string; name: string; phone_number: Record<string, never>; type: "phone_number"; } | { description?: string; id: string; name: string; place: Record<string, never>; type: "place"; } | { description?: string; id: string; name: string; relation: { data_source_id: string; synced_property_id: string; synced_property_name: string; }; type: "relation"; } | { description?: string; id: string; name: string; rich_text: Record<string, never>; type: "rich_text"; } | { description?: string; id: string; name: string; rollup: { function: "range" | "checked" | "average" | "count_per_group" | "count" | "count_values" | "date_range" | "earliest_date" | "empty" | "latest_date" | "max" | "median" | "min" | "not_empty" | "percent_checked" | "percent_empty" | "percent_not_empty" | "percent_per_group" | "percent_unchecked" | "unchecked" | "unique" | "show_original" | "show_unique" | "sum"; relation_property_id: string; relation_property_name: string; rollup_property_id: string; rollup_property_name: string; }; type: "rollup"; } | { description?: string; id: string; name: string; select: { options: object[]; }; type: "select"; } | { description?: string; id: string; name: string; status: { groups: object[]; options: object[]; }; type: "status"; } | { description?: string; id: string; name: string; title: Record<string, never>; type: "title"; } | { description?: string; id: string; name: string; type: "url"; url: Record<string, never>; } | { description?: string; id: string; name: string; type: "unique_id"; unique_id: { prefix?: string; }; }> = propertiesObjectSchema
Schema of properties for the data source as they appear in Notion
public_url
Section titled “public_url”string | null = ...
The public URL if published, otherwise null
({ annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; plain_text: string; text: { content: string; link: { url: string; } | null; }; type: "text"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; mention: { database: { id: string; }; type: "database"; } | { date: { end: string | null; start: string; time_zone?: string | null; }; type: "date"; } | { link_preview: { url: string; }; type: "link_preview"; } | { page: { id: string; }; type: "page"; } | { template_mention: { template_mention_date: "today" | "now"; type: "template_mention_date"; } | { template_mention_user: "me"; type: "template_mention_user"; }; type: "template_mention"; } | { type: "user"; user: { 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: …; } | { type: …; }; workspace_id?: string; workspace_limits?: { max_file_upload_size_in_bytes: …; }; workspace_name?: string | null; }; id: string; name?: string; object: "user"; type: "bot"; } | { id: string; object: "user"; }; }; plain_text: string; type: "mention"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; equation: { expression: string; }; href: string | null; plain_text: string; type: "equation"; })[] = richTextSchema
Name of the data source as it appears in Notion
string = ...
The Notion URL of the data source
Returns
Section titled “Returns”DataSource
Overrides
Section titled “Overrides”BaseModel<NotionDataSource>.constructor
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get cover(): {
file: {expiry_time:string;url:string; };type:"file"; } | {file_upload: {id:string; };type:"file_upload"; } | {external: {url:string; };type:"external"; } |null
Defined in: src/models/dataSource.model.ts:113
Returns the data source cover image.
Returns
Section titled “Returns”{ file: { expiry_time: string; url: string; }; type: "file"; } | { file_upload: { id: string; }; type: "file_upload"; } | { external: { url: string; }; type: "external"; } | null
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/dataSource.model.ts:71
Returns the user who created the data source.
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/dataSource.model.ts:64
Returns the created time as a Date object.
Returns
Section titled “Returns”Date
databaseParent
Section titled “databaseParent”Get Signature
Section titled “Get Signature”get databaseParent(): {
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/dataSource.model.ts:57
Returns the database parent object (data source’s grandparent).
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"; }
description
Section titled “description”Get Signature
Section titled “Get Signature”get description(): ({
annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;plain_text:string;text: {content:string;link: {url:string; } |null; };type:"text"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;mention: {database: {id:string; };type:"database"; } | {date: {end:string|null;start:string;time_zone?:string|null; };type:"date"; } | {link_preview: {url:string; };type:"link_preview"; } | {page: {id:string; };type:"page"; } | {template_mention: {template_mention_date:"today"|"now";type:"template_mention_date"; } | {template_mention_user:"me";type:"template_mention_user"; };type:"template_mention"; } | {type:"user";user: {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"; }; };plain_text:string;type:"mention"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };equation: {expression:string; };href:string|null;plain_text:string;type:"equation"; })[]
Defined in: src/models/dataSource.model.ts:99
Returns the data source description as rich text array.
Returns
Section titled “Returns”({ annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; plain_text: string; text: { content: string; link: { url: string; } | null; }; type: "text"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; mention: { database: { id: string; }; type: "database"; } | { date: { end: string | null; start: string; time_zone?: string | null; }; type: "date"; } | { link_preview: { url: string; }; type: "link_preview"; } | { page: { id: string; }; type: "page"; } | { template_mention: { template_mention_date: "today" | "now"; type: "template_mention_date"; } | { template_mention_user: "me"; type: "template_mention_user"; }; type: "template_mention"; } | { type: "user"; user: { 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"; }; }; plain_text: string; type: "mention"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; equation: { expression: string; }; href: string | null; plain_text: string; type: "equation"; })[]
Get Signature
Section titled “Get Signature”get icon(): {
file: {expiry_time:string;url:string; };type:"file"; } | {file_upload: {id:string; };type:"file_upload"; } | {external: {url:string; };type:"external"; } | {emoji:string;type:"emoji"; } | {icon: {color?:"blue"|"brown"|"gray"|"green"|"orange"|"pink"|"purple"|"red"|"yellow"|"lightgray";name:string; };type:"icon"; } | {custom_emoji: {id:string;name?:string;url?:string; };type:"custom_emoji"; } |null
Defined in: src/models/dataSource.model.ts:106
Returns the data source icon (file, emoji, native icon, or custom emoji).
Returns
Section titled “Returns”{ file: { expiry_time: string; url: string; }; type: "file"; } | { file_upload: { id: string; }; type: "file_upload"; } | { external: { url: string; }; type: "external"; } | { emoji: string; type: "emoji"; } | { icon: { color?: "blue" | "brown" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | "lightgray"; name: string; }; type: "icon"; } | { custom_emoji: { id: string; name?: string; url?: string; }; type: "custom_emoji"; } | null
Get Signature
Section titled “Get Signature”get id():
string
Defined in: src/models/dataSource.model.ts:36
Returns the data source ID.
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”inTrash
Section titled “inTrash”Get Signature
Section titled “Get Signature”get inTrash():
boolean
Defined in: src/models/dataSource.model.ts:141
Returns whether the data source is in trash.
Returns
Section titled “Returns”boolean
isInline
Section titled “isInline”Get Signature
Section titled “Get Signature”get isInline():
boolean
Defined in: src/models/dataSource.model.ts:134
Returns whether the data source is inline.
Returns
Section titled “Returns”boolean
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/dataSource.model.ts:85
Returns the user who last edited the data source.
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/dataSource.model.ts:78
Returns the last edited time as a Date object.
Returns
Section titled “Returns”Date
object
Section titled “object”Get Signature
Section titled “Get Signature”get object():
"data_source"
Defined in: src/models/dataSource.model.ts:29
Returns “data_source” - the object type.
Returns
Section titled “Returns”"data_source"
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/dataSource.model.ts:50
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"; }
properties
Section titled “properties”Get Signature
Section titled “Get Signature”get properties():
NotionPropertiesObject
Defined in: src/models/dataSource.model.ts:43
Returns the properties object (data source schema).
Returns
Section titled “Returns”publicUrl
Section titled “publicUrl”Get Signature
Section titled “Get Signature”get publicUrl():
string|null
Defined in: src/models/dataSource.model.ts:127
Returns the public URL if published, otherwise null.
Returns
Section titled “Returns”string | null
Get Signature
Section titled “Get Signature”get title(): ({
annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;plain_text:string;text: {content:string;link: {url:string; } |null; };type:"text"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;mention: {database: {id:string; };type:"database"; } | {date: {end:string|null;start:string;time_zone?:string|null; };type:"date"; } | {link_preview: {url:string; };type:"link_preview"; } | {page: {id:string; };type:"page"; } | {template_mention: {template_mention_date:"today"|"now";type:"template_mention_date"; } | {template_mention_user:"me";type:"template_mention_user"; };type:"template_mention"; } | {type:"user";user: {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"; }; };plain_text:string;type:"mention"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };equation: {expression:string; };href:string|null;plain_text:string;type:"equation"; })[]
Defined in: src/models/dataSource.model.ts:92
Returns the data source title as rich text array.
Returns
Section titled “Returns”({ annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; plain_text: string; text: { content: string; link: { url: string; } | null; }; type: "text"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; href: string | null; mention: { database: { id: string; }; type: "database"; } | { date: { end: string | null; start: string; time_zone?: string | null; }; type: "date"; } | { link_preview: { url: string; }; type: "link_preview"; } | { page: { id: string; }; type: "page"; } | { template_mention: { template_mention_date: "today" | "now"; type: "template_mention_date"; } | { template_mention_user: "me"; type: "template_mention_user"; }; type: "template_mention"; } | { type: "user"; user: { 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"; }; }; plain_text: string; type: "mention"; } | { annotations: { bold: boolean; code: boolean; color: "default" | "blue" | "blue_background" | "brown" | "brown_background" | "gray" | "gray_background" | "green" | "green_background" | "orange" | "orange_background" | "pink" | "pink_background" | "purple" | "purple_background" | "red" | "red_background" | "yellow" | "yellow_background"; italic: boolean; strikethrough: boolean; underline: boolean; }; equation: { expression: string; }; href: string | null; plain_text: string; type: "equation"; })[]
Get Signature
Section titled “Get Signature”get url():
string
Defined in: src/models/dataSource.model.ts:120
Returns the Notion URL of the data source.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”getDescription()
Section titled “getDescription()”getDescription():
string
Defined in: src/models/dataSource.model.ts:155
Extracts the plain text description from the data source.
Returns
Section titled “Returns”string
getParentDatabaseId()
Section titled “getParentDatabaseId()”getParentDatabaseId():
string|undefined
Defined in: src/models/dataSource.model.ts:162
Returns the parent database ID if parent type is database_id.
Returns
Section titled “Returns”string | undefined
getProperty()
Section titled “getProperty()”getProperty(
name): {checkbox:Record<string,never>;description?:string;id:string;name:string;type:"checkbox"; } | {created_by:Record<string,never>;description?:string;id:string;name:string;type:"created_by"; } | {created_time:Record<string,never>;description?:string;id:string;name:string;type:"created_time"; } | {date:Record<string,never>;description?:string;id:string;name:string;type:"date"; } | {description?:string;Record<string,never>;id:string;name:string;type:"email"; } | {description?:string;files:Record<string,never>;id:string;name:string;type:"files"; } | {description?:string;formula: {expression:string; };id:string;name:string;type:"formula"; } | {description?:string;id:string;last_edited_by:Record<string,never>;name:string;type:"last_edited_by"; } | {description?:string;id:string;last_edited_time:Record<string,never>;name:string;type:"last_edited_time"; } | {description?:string;id:string;multi_select: {options:object[]; };name:string;type:"multi_select"; } | {description?:string;id:string;name:string;number: {format:"number"|"argentine_peso"|"baht"|"australian_dollar"|"canadian_dollar"|"chilean_peso"|"colombian_peso"|"danish_krone"|"dirham"|"dollar"|"euro"|"forint"|"franc"|"hong_kong_dollar"|"koruna"|"krona"|"leu"|"lira"|"mexican_peso"|"new_taiwan_dollar"|"new_zealand_dollar"|"norwegian_krone"|"number_with_commas"|"percent"|"philippine_peso"|"pound"|"peruvian_sol"|"rand"|"real"|"ringgit"|"riyal"|"ruble"|"rupee"|"rupiah"|"shekel"|"singapore_dollar"|"uruguayan_peso"|"yen"|"yuan"|"won"|"zloty"; };type:"number"; } | {description?:string;id:string;name:string;people:Record<string,never>;type:"people"; } | {description?:string;id:string;name:string;phone_number:Record<string,never>;type:"phone_number"; } | {description?:string;id:string;name:string;place:Record<string,never>;type:"place"; } | {description?:string;id:string;name:string;relation: {data_source_id:string;synced_property_id:string;synced_property_name:string; };type:"relation"; } | {description?:string;id:string;name:string;rich_text:Record<string,never>;type:"rich_text"; } | {description?:string;id:string;name:string;rollup: {function:"range"|"checked"|"average"|"count_per_group"|"count"|"count_values"|"date_range"|"earliest_date"|"empty"|"latest_date"|"max"|"median"|"min"|"not_empty"|"percent_checked"|"percent_empty"|"percent_not_empty"|"percent_per_group"|"percent_unchecked"|"unchecked"|"unique"|"show_original"|"show_unique"|"sum";relation_property_id:string;relation_property_name:string;rollup_property_id:string;rollup_property_name:string; };type:"rollup"; } | {description?:string;id:string;name:string;select: {options:object[]; };type:"select"; } | {description?:string;id:string;name:string;status: {groups:object[];options:object[]; };type:"status"; } | {description?:string;id:string;name:string;title:Record<string,never>;type:"title"; } | {description?:string;id:string;name:string;type:"url";url:Record<string,never>; } | {description?:string;id:string;name:string;type:"unique_id";unique_id: {prefix?:string; }; } |undefined
Defined in: src/models/dataSource.model.ts:172
Gets a specific property configuration by name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”{ checkbox: Record<string, never>; description?: string; id: string; name: string; type: "checkbox"; } | { created_by: Record<string, never>; description?: string; id: string; name: string; type: "created_by"; } | { created_time: Record<string, never>; description?: string; id: string; name: string; type: "created_time"; } | { date: Record<string, never>; description?: string; id: string; name: string; type: "date"; } | { description?: string; email: Record<string, never>; id: string; name: string; type: "email"; } | { description?: string; files: Record<string, never>; id: string; name: string; type: "files"; } | { description?: string; formula: { expression: string; }; id: string; name: string; type: "formula"; } | { description?: string; id: string; last_edited_by: Record<string, never>; name: string; type: "last_edited_by"; } | { description?: string; id: string; last_edited_time: Record<string, never>; name: string; type: "last_edited_time"; } | { description?: string; id: string; multi_select: { options: object[]; }; name: string; type: "multi_select"; } | { description?: string; id: string; name: string; number: { format: "number" | "argentine_peso" | "baht" | "australian_dollar" | "canadian_dollar" | "chilean_peso" | "colombian_peso" | "danish_krone" | "dirham" | "dollar" | "euro" | "forint" | "franc" | "hong_kong_dollar" | "koruna" | "krona" | "leu" | "lira" | "mexican_peso" | "new_taiwan_dollar" | "new_zealand_dollar" | "norwegian_krone" | "number_with_commas" | "percent" | "philippine_peso" | "pound" | "peruvian_sol" | "rand" | "real" | "ringgit" | "riyal" | "ruble" | "rupee" | "rupiah" | "shekel" | "singapore_dollar" | "uruguayan_peso" | "yen" | "yuan" | "won" | "zloty"; }; type: "number"; } | { description?: string; id: string; name: string; people: Record<string, never>; type: "people"; } | { description?: string; id: string; name: string; phone_number: Record<string, never>; type: "phone_number"; } | { description?: string; id: string; name: string; place: Record<string, never>; type: "place"; } | { description?: string; id: string; name: string; relation: { data_source_id: string; synced_property_id: string; synced_property_name: string; }; type: "relation"; } | { description?: string; id: string; name: string; rich_text: Record<string, never>; type: "rich_text"; } | { description?: string; id: string; name: string; rollup: { function: "range" | "checked" | "average" | "count_per_group" | "count" | "count_values" | "date_range" | "earliest_date" | "empty" | "latest_date" | "max" | "median" | "min" | "not_empty" | "percent_checked" | "percent_empty" | "percent_not_empty" | "percent_per_group" | "percent_unchecked" | "unchecked" | "unique" | "show_original" | "show_unique" | "sum"; relation_property_id: string; relation_property_name: string; rollup_property_id: string; rollup_property_name: string; }; type: "rollup"; } | { description?: string; id: string; name: string; select: { options: object[]; }; type: "select"; } | { description?: string; id: string; name: string; status: { groups: object[]; options: object[]; }; type: "status"; } | { description?: string; id: string; name: string; title: Record<string, never>; type: "title"; } | { description?: string; id: string; name: string; type: "url"; url: Record<string, never>; } | { description?: string; id: string; name: string; type: "unique_id"; unique_id: { prefix?: string; }; } | undefined
getPropertyNames()
Section titled “getPropertyNames()”getPropertyNames():
string[]
Defined in: src/models/dataSource.model.ts:179
Gets all property names.
Returns
Section titled “Returns”string[]
getTitle()
Section titled “getTitle()”getTitle():
string
Defined in: src/models/dataSource.model.ts:148
Extracts the plain text title from the data source.
Returns
Section titled “Returns”string
hasProperty()
Section titled “hasProperty()”hasProperty(
name):boolean
Defined in: src/models/dataSource.model.ts:186
Checks if the data source has a specific property.
Parameters
Section titled “Parameters”string
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”cover: {
file: {expiry_time:string;url:string; };type:"file"; } | {file_upload: {id:string; };type:"file_upload"; } | {external: {url:string; };type:"external"; } |null
Data source cover image
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
User who created the data source
created_time
Section titled “created_time”created_time:
string=notionDateStringSchema
Creation date and time for this data source, in ISO 8601 format
database_parent
Section titled “database_parent”database_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"; } =parentSchema
Information about the database’s parent (the data source’s grandparent)
description
Section titled “description”description: ({
annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;plain_text:string;text: {content:string;link: {url:string; } |null; };type:"text"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;mention: {database: {id:string; };type:"database"; } | {date: {end:string|null;start:string;time_zone?:string|null; };type:"date"; } | {link_preview: {url:string; };type:"link_preview"; } | {page: {id:string; };type:"page"; } | {template_mention: {template_mention_date:"today"|"now";type:"template_mention_date"; } | {template_mention_user:"me";type:"template_mention_user"; };type:"template_mention"; } | {type:"user";user: {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: …; } | {type: …; };workspace_id?:string;workspace_limits?: {max_file_upload_size_in_bytes: …; };workspace_name?:string|null; };id:string;name?:string;object:"user";type:"bot"; } | {id:string;object:"user"; }; };plain_text:string;type:"mention"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };equation: {expression:string; };href:string|null;plain_text:string;type:"equation"; })[] =richTextSchema
Description of the data source as it appears in Notion
icon: {
file: {expiry_time:string;url:string; };type:"file"; } | {file_upload: {id:string; };type:"file_upload"; } | {external: {url:string; };type:"external"; } | {emoji:string;type:"emoji"; } | {icon: {color?:"blue"|"brown"|"gray"|"green"|"orange"|"pink"|"purple"|"red"|"yellow"|"lightgray";name:string; };type:"icon"; } | {custom_emoji: {id:string;name?:string;url?:string; };type:"custom_emoji"; } |null
Data source icon (File, Emoji, Native Icon, or Custom Emoji object)
id:
string
Unique identifier for the data source
in_trash
Section titled “in_trash”in_trash:
boolean
Whether the data source is in the trash
is_inline
Section titled “is_inline”is_inline:
boolean
Whether the data source is inline
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
User who last edited the data source
last_edited_time
Section titled “last_edited_time”last_edited_time:
string=notionDateStringSchema
Last edited date and time for this data source, in ISO 8601 format
object
Section titled “object”object:
"data_source"
Always “data_source”
parent
Section titled “parent”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"; } =parentSchema
Information about the data source’s parent database
properties
Section titled “properties”properties:
Record<string, {checkbox:Record<string,never>;description?:string;id:string;name:string;type:"checkbox"; } | {created_by:Record<string,never>;description?:string;id:string;name:string;type:"created_by"; } | {created_time:Record<string,never>;description?:string;id:string;name:string;type:"created_time"; } | {date:Record<string,never>;description?:string;id:string;name:string;type:"date"; } | {description?:string;Record<string,never>;id:string;name:string;type:"email"; } | {description?:string;files:Record<string,never>;id:string;name:string;type:"files"; } | {description?:string;formula: {expression:string; };id:string;name:string;type:"formula"; } | {description?:string;id:string;last_edited_by:Record<string,never>;name:string;type:"last_edited_by"; } | {description?:string;id:string;last_edited_time:Record<string,never>;name:string;type:"last_edited_time"; } | {description?:string;id:string;multi_select: {options:object[]; };name:string;type:"multi_select"; } | {description?:string;id:string;name:string;number: {format:"number"|"argentine_peso"|"baht"|"australian_dollar"|"canadian_dollar"|"chilean_peso"|"colombian_peso"|"danish_krone"|"dirham"|"dollar"|"euro"|"forint"|"franc"|"hong_kong_dollar"|"koruna"|"krona"|"leu"|"lira"|"mexican_peso"|"new_taiwan_dollar"|"new_zealand_dollar"|"norwegian_krone"|"number_with_commas"|"percent"|"philippine_peso"|"pound"|"peruvian_sol"|"rand"|"real"|"ringgit"|"riyal"|"ruble"|"rupee"|"rupiah"|"shekel"|"singapore_dollar"|"uruguayan_peso"|"yen"|"yuan"|"won"|"zloty"; };type:"number"; } | {description?:string;id:string;name:string;people:Record<string,never>;type:"people"; } | {description?:string;id:string;name:string;phone_number:Record<string,never>;type:"phone_number"; } | {description?:string;id:string;name:string;place:Record<string,never>;type:"place"; } | {description?:string;id:string;name:string;relation: {data_source_id:string;synced_property_id:string;synced_property_name:string; };type:"relation"; } | {description?:string;id:string;name:string;rich_text:Record<string,never>;type:"rich_text"; } | {description?:string;id:string;name:string;rollup: {function:"range"|"checked"|"average"|"count_per_group"|"count"|"count_values"|"date_range"|"earliest_date"|"empty"|"latest_date"|"max"|"median"|"min"|"not_empty"|"percent_checked"|"percent_empty"|"percent_not_empty"|"percent_per_group"|"percent_unchecked"|"unchecked"|"unique"|"show_original"|"show_unique"|"sum";relation_property_id:string;relation_property_name:string;rollup_property_id:string;rollup_property_name:string; };type:"rollup"; } | {description?:string;id:string;name:string;select: {options:object[]; };type:"select"; } | {description?:string;id:string;name:string;status: {groups:object[];options:object[]; };type:"status"; } | {description?:string;id:string;name:string;title:Record<string,never>;type:"title"; } | {description?:string;id:string;name:string;type:"url";url:Record<string,never>; } | {description?:string;id:string;name:string;type:"unique_id";unique_id: {prefix?:string; }; }> =propertiesObjectSchema
Schema of properties for the data source as they appear in Notion
public_url
Section titled “public_url”public_url:
string|null
The public URL if published, otherwise null
title: ({
annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;plain_text:string;text: {content:string;link: {url:string; } |null; };type:"text"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };href:string|null;mention: {database: {id:string; };type:"database"; } | {date: {end:string|null;start:string;time_zone?:string|null; };type:"date"; } | {link_preview: {url:string; };type:"link_preview"; } | {page: {id:string; };type:"page"; } | {template_mention: {template_mention_date:"today"|"now";type:"template_mention_date"; } | {template_mention_user:"me";type:"template_mention_user"; };type:"template_mention"; } | {type:"user";user: {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: …; } | {type: …; };workspace_id?:string;workspace_limits?: {max_file_upload_size_in_bytes: …; };workspace_name?:string|null; };id:string;name?:string;object:"user";type:"bot"; } | {id:string;object:"user"; }; };plain_text:string;type:"mention"; } | {annotations: {bold:boolean;code:boolean;color:"default"|"blue"|"blue_background"|"brown"|"brown_background"|"gray"|"gray_background"|"green"|"green_background"|"orange"|"orange_background"|"pink"|"pink_background"|"purple"|"purple_background"|"red"|"red_background"|"yellow"|"yellow_background";italic:boolean;strikethrough:boolean;underline:boolean; };equation: {expression:string; };href:string|null;plain_text:string;type:"equation"; })[] =richTextSchema
Name of the data source as it appears in Notion
url:
string
The Notion URL of the data source