Options
All
  • Public
  • Public/Protected
  • All
Menu

notionapi-agent

Index

Namespaces

Error Classes

Library Interfaces

Other Interfaces

Type aliases

Library Internal Variables

Other Variables

Library Functions

Library Internal Functions

Library Constant Object literals

Type aliases

ActivityRecord

ActivityRecord: Record<Activity>

ActivityType

ActivityType: "block-edited" | "collection-edited" | "collection-view-edited" | "collection-row-created" | "collection-property-edited"

AdvancedBlockUnion

AggregationResult

AggregationType

AggregationType union.

AnyRecord

AnyRecord: Record<RecordUnion>

BasicBlockUnion

BlockRecord

BlockRecord: Record<Block>

BlockType

BlockType: "page" | "text" | "bulleted_list" | "numbered_list" | "to_do" | "toggle" | "header" | "sub_header" | "sub_sub_header" | "quote" | "callout" | "column_list" | "column" | "divider" | "collection_view" | "collection_view_page" | "image" | "video" | "audio" | "bookmark" | "code" | "file" | "embed" | "codepen" | "invision" | "pdf" | "table_of_contents" | "equation" | "factory" | "breadcrumb"

All block names.

CheckboxAggregationType

CheckboxAggregationType: "count" | CheckboxSpecificAggregationType

CheckboxComparator

CheckboxComparator: CheckboxSpecificComparator

CheckboxSpecificAggregationType

CheckboxSpecificAggregationType: "checked" | "unchecked" | "percent_checked" | "percent_unchecked"

CheckboxSpecificComparator

CheckboxSpecificComparator: "checkbox_is" | "checkbox_is_not"

CollectionRecord

CollectionRecord: Record<Collection>

CollectionViewRecord

CollectionViewRecord: Record<CollectionView>

CommentRecord

CommentRecord: Record<Comment>

Comparator

Comparator union.

CountAggregationType

CountAggregationType: "count" | "count_values" | "unique" | "empty" | "not_empty"

Fundamental aggregation types.

CreatedEditedByAggregationType

CreatedEditedByAggregationType: GeneralAggregationType

CreatedEditedByComparator

CreatedEditedByComparator: SelectComparator

CreatedEditedTimeAggregationType

CreatedEditedTimeAggregationType: DateAggregationType

CreatedEditedTimeComparator

CreatedEditedTimeComparator: DateComparator

DatabaseBlockUnion

DateAggregationType

DateComparator

DateSpecificAggregationType

DateSpecificAggregationType: "earliest_date" | "latest_date" | "date_range"

DateSpecificComparator

DateSpecificComparator: "date_is" | "date_is_within" | "date_is_before" | "date_is_after" | "date_is_on_or_before" | "date_is_on_or_after"

DiscussionRecord

DiscussionRecord: Record<Discussion>

Edit

EditType

EditType: "block-created" | "block-changed" | "collection-view-created" | "collection-view-changed" | "collection-property-deleted"

EmailAggregationType

EmailAggregationType: GeneralAggregationType

EmailComparator

EmbedBlockUnion

EmbedBlockUnion: Embed | Codepen | Invision | PDF

EmptinessComparator

EmptinessComparator: "is_empty" | "is_not_empty"

Fundamental comparators.

EnumMultipleComparator

EnumMultipleComparator: "enum_contains" | "enum_does_not_contain"

EnumSingleComparator

EnumSingleComparator: "enum_is" | "enum_is_not"

FileAggregationType

FileAggregationType: GeneralAggregationType

FileComparator

FileComparator: EmptinessComparator

FilterOperator

FilterOperator: "and" | "or"

FilterValueType

In Filter, when value exists, this describes the type of value, otherwise, an instruction to get value.

FilterValueTypeDateIsOnBeforeAfter

FilterValueTypeDateIsOnBeforeAfter: "exact_date" | "today" | "tomorrow" | "yesterday" | "one_week_ago" | "one_week_from_now" | "one_month_ago" | "one_month_from_now"

Valid FilterValueType when Comparator is "date_is", "date_is_before", "date_is_after", "date_is_on_or_before", "date_is_on_or_after".

FilterValueTypeDateIsWithin

FilterValueTypeDateIsWithin: "the_past_week" | "the_past_month" | "the_past_year" | "the_next_week" | "the_next_month" | "the_next_year"

Valid FilterValueType when Comparator is "date_is_within".

FilterValueTypePerson

FilterValueTypePerson: "person"

Valid FilterValueType when PropertyType is "person".

FollowRecord

FollowRecord: Record<Follow>

GeneralAggregationType

Abstracted structure aggregation types.

Map

Map<T>: {}

Type parameters

  • T

Type declaration

  • [key: string]: T

    key is an UUID.

    An example of Map<T> :

    { "0297b381-6319-417b-a4f8-2ca1f2a96a81": T }

MediaBlockUnion

MediaBlockUnion: Image | Video | Audio | Bookmark | Code | File

MultiSelectAggregationType

MultiSelectAggregationType: GeneralAggregationType

MultiSelectComparator

NotionUserRecord

NotionUserRecord: Record<NotionUser>

NumberAggregationType

NumberComparator

NumberSpecificAggregationType

NumberSpecificAggregationType: "sum" | "average" | "median" | "min" | "max" | "range"

NumberSpecificComparator

NumberSpecificComparator: "number_equals" | "number_does_not_equal" | "number_greater_than" | "number_less_than" | "number_greater_than_or_equal_to" | "number_less_than_or_equal_to"

PercentAggregationType

PercentAggregationType: "percent_empty" | "percent_not_empty"

PersonAggregationType

PersonAggregationType: GeneralAggregationType

PersonComparator

PhoneAggregationType

PhoneAggregationType: GeneralAggregationType

PhoneComparator

Record

Record<T>: { role: Role; value?: T }

Type parameters

  • T

Type declaration

  • role: Role
  • Optional value?: T

    Undefined if role is "none".

RecordUnion

SelectAggregationType

SelectAggregationType: GeneralAggregationType

SelectComparator

SlackIntegrationRecord

SlackIntegrationRecord: Record<SlackIntegration>

SortDirection

SortDirection: "ascending" | "descending"

SpaceRecord

SpaceRecord: Record<Space>

SpaceViewRecord

SpaceViewRecord: Record<SpaceView>

StringComparator

StringComparator: "string_is" | "string_is_not" | "string_contains" | "string_does_not_contain" | "string_starts_with" | "string_ends_with"

TextAggregationType

TextAggregationType: GeneralAggregationType

TextComparator

TitleAggregationType

TitleAggregationType: GeneralAggregationType

TitleComparator

Abstracted structure comparators.

URLAggregationType

URLAggregationType: GeneralAggregationType

URLComparator

UserRootRecord

UserRootRecord: Record<UserRoot>

UserSettingsRecord

UserSettingsRecord: Record<UserSettings>

Library Internal Variables

Const log

log: any = new Logger("notionapi-agent")

Other Variables

Const URL

URL: any = (typeof window !== "undefined" && window.URL) ?window.URL : require("url").URL

Import libraries.

Library Functions

createAgent

  • Create a Notion API agent.

    Parameters

    Returns Agent

Library Internal Functions

createAPI

  • createAPI<Req, Res>(url: string, token: string): (Anonymous function)
  • Create an asynchronous Notion API function.

    Type parameters

    • Req

    • Res

    Parameters

    • url: string

      The API's full URL.

    • token: string

      The API token for authentication.

    Returns (Anonymous function)

post

  • post(url: string): { sendAsJson: any; setHeader: any }
  • Parameters

    • url: string

    Returns { sendAsJson: any; setHeader: any }

    • sendAsJson: function
      • sendAsJson(body?: any): Promise<any>
      • Parameters

        • Optional body: any

        Returns Promise<any>

    • setHeader: function
      • setHeader(key: string, value: string)
      • Parameters

        • key: string
        • value: string

Library Constant Object literals

Const Default

Default: object

server

server: string = "https://www.notion.so"

userAgent

userAgent: string = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"

Generated using TypeDoc