queries

@nishans/endpoints / Exports / Queries

Class: Queries#

A class containing all the api endpoints of Notion

noinheritdoc

Hierarchy#

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new Queries(params: Pick<CtorArgs, token | interval | user_id | cache>): Queries

Parameters:#

NameType
paramsPick<CtorArgs, token | interval | user_id | cache>

Returns: Queries

Inherited from: Cache

Defined in: src/Queries.ts:52

Properties#

cache#

• cache: ICache

Inherited from: Cache.cache

Defined in: src/Cache.ts:6


headers#

• headers: { headers: { cookie: string ; x-notion-active-user-header: string } }

Type declaration:#

NameType
headers{ cookie: string ; x-notion-active-user-header: string }

Inherited from: Cache.headers

Defined in: src/Cache.ts:9


interval#

• interval: number

Inherited from: Cache.interval

Defined in: src/Cache.ts:8


token#

• token: string

Inherited from: Cache.token

Defined in: src/Cache.ts:7


user_id#

• user_id: string

Inherited from: Cache.user_id

Defined in: src/Cache.ts:15

Methods#

findUser#

â–¸ findUser(params: FindUserParams): Promise<FindUserResult>

Parameters:#

NameType
paramsFindUserParams

Returns: Promise<FindUserResult>

Defined in: src/Queries.ts:111


getBacklinksForBlock#

â–¸ getBacklinksForBlock(params: GetBackLinksForBlockParams): Promise<GetBackLinksForBlockResult>

Parameters:#

NameType
paramsGetBackLinksForBlockParams

Returns: Promise<GetBackLinksForBlockResult>

Defined in: src/Queries.ts:105


getConfigs#

â–¸ getConfigs(): Configs

Returns: Configs

Inherited from: Cache

Defined in: src/Cache.ts:39


getGenericEmbedBlockData#

â–¸ getGenericEmbedBlockData(arg: GetGenericEmbedBlockDataParams): Promise<GetGenericEmbedBlockDataResult>

Parameters:#

NameType
argGetGenericEmbedBlockDataParams

Returns: Promise<GetGenericEmbedBlockDataResult>

Defined in: src/Queries.ts:93


getGoogleDriveAccounts#

â–¸ getGoogleDriveAccounts(): Promise<GetGoogleDriveAccountsResult>

Returns: Promise<GetGoogleDriveAccountsResult>

Defined in: src/Queries.ts:101


getJoinableSpaces#

â–¸ getJoinableSpaces(): Promise<GetJoinableSpacesResult>

Returns: Promise<GetJoinableSpacesResult>

Defined in: src/Queries.ts:139


getPageVisits#

â–¸ getPageVisits(arg: GetPageVisitsParams): Promise<GetPageVisitsResult>

Parameters:#

NameType
argGetPageVisitsParams

Returns: Promise<GetPageVisitsResult>

Defined in: src/Queries.ts:57


getPublicPageData#

â–¸ getPublicPageData(arg: GetPublicPageDataParams): Promise<GetPublicPageDataResult>

Parameters:#

NameType
argGetPublicPageDataParams

Returns: Promise<GetPublicPageDataResult>

Defined in: src/Queries.ts:69


getPublicSpaceData#

â–¸ getPublicSpaceData(arg: GetPublicSpaceDataParams): Promise<GetPublicSpaceDataResult>

Parameters:#

NameType
argGetPublicSpaceDataParams

Returns: Promise<GetPublicSpaceDataResult>

Defined in: src/Queries.ts:73


getSpaces#

â–¸ getSpaces(): Promise<GetSpacesResult>

Returns: Promise<GetSpacesResult>

Defined in: src/Queries.ts:87


getSubscriptionData#

â–¸ getSubscriptionData(arg: GetSubscriptionDataParams): Promise<GetSubscriptionDataResult>

Parameters:#

NameType
argGetSubscriptionDataParams

Returns: Promise<GetSubscriptionDataResult>

Defined in: src/Queries.ts:77


getTasks#

â–¸ getTasks(params: GetTasksParams): Promise<GetTasksResult>

Parameters:#

NameType
paramsGetTasksParams

Returns: Promise<GetTasksResult>

Defined in: src/Queries.ts:155


getUploadFileUrl#

â–¸ getUploadFileUrl(arg: GetUploadFileUrlParams): Promise<GetUploadFileUrlResult>

Parameters:#

NameType
argGetUploadFileUrlParams

Returns: Promise<GetUploadFileUrlResult>

Defined in: src/Queries.ts:97


getUserNotifications#

â–¸ getUserNotifications(params: GetUserNotificationsParams): Promise<GetUserNotificationsResult>

Parameters:#

NameType
paramsGetUserNotificationsParams

Returns: Promise<GetUserNotificationsResult>

Defined in: src/Queries.ts:151


getUserSharedPages#

â–¸ getUserSharedPages(arg: GetUserSharedPagesParams): Promise<GetUserSharedPagesResult>

Parameters:#

NameType
argGetUserSharedPagesParams

Returns: Promise<GetUserSharedPagesResult>

Defined in: src/Queries.ts:61


getUserTasks#

â–¸ getUserTasks(): Promise<GetUserTasksResult>

Returns: Promise<GetUserTasksResult>

Defined in: src/Queries.ts:65


initializeCache#

â–¸ initializeCache(): Promise<void>

Returns: Promise<void>

Inherited from: Cache

Defined in: src/Cache.ts:66


initializeCacheForSpecificData#

â–¸ initializeCacheForSpecificData(id: string, type: block | collection | collection_view | space | notion_user | space_view | user_root | user_settings): Promise<void>

Parameters:#

NameType
idstring
typeblock | collection | collection_view | space | notion_user | space_view | user_root | user_settings

Returns: Promise<void>

Inherited from: Cache

Defined in: src/Cache.ts:110


isEmailEducation#

â–¸ isEmailEducation(): Promise<IsEmailEducationResult>

Returns: Promise<IsEmailEducationResult>

Defined in: src/Queries.ts:147


isUserDomainJoinable#

â–¸ isUserDomainJoinable(): Promise<IsUserDomainJoinableResult>

Returns: Promise<IsUserDomainJoinableResult>

Defined in: src/Queries.ts:143


loadBlockSubtree#

â–¸ loadBlockSubtree(arg: LoadBlockSubtreeParams): Promise<LoadBlockSubtreeResult>

Parameters:#

NameType
argLoadBlockSubtreeParams

Returns: Promise<LoadBlockSubtreeResult>

Defined in: src/Queries.ts:81


loadPageChunk#

â–¸ loadPageChunk(params: LoadPageChunkParams): Promise<LoadPageChunkResult>

Parameters:#

NameType
paramsLoadPageChunkParams

Returns: Promise<LoadPageChunkResult>

Defined in: src/Queries.ts:133


loadUserContent#

â–¸ loadUserContent(): Promise<LoadUserContentResult>

Returns: Promise<LoadUserContentResult>

Defined in: src/Queries.ts:127


queryCollection#

â–¸ queryCollection(params: QueryCollectionParams): Promise<QueryCollectionResult>

Parameters:#

NameType
paramsQueryCollectionParams

Returns: Promise<QueryCollectionResult>

Defined in: src/Queries.ts:121


recordPageVisit#

â–¸ recordPageVisit(params: RecordPageVisitParams): Promise<GetPageVisitsResult>

Parameters:#

NameType
paramsRecordPageVisitParams

Returns: Promise<GetPageVisitsResult>

Defined in: src/Queries.ts:159


returnNonCachedData#

â–¸ returnNonCachedData(ids: UpdateCacheManuallyParam): UpdateCacheManuallyParam

Parameters:#

NameType
idsUpdateCacheManuallyParam

Returns: UpdateCacheManuallyParam

Inherited from: Cache

Defined in: src/Cache.ts:60


saveToCache#

â–¸ saveToCache(recordMap: Partial<RecordMap>): void

Save the passed recordMap to cache

Parameters:#

NameTypeDescription
recordMapPartial<RecordMap>RecordMap map to save to cache

Returns: void

Inherited from: Cache

Defined in: src/Cache.ts:51


syncRecordValues#

â–¸ syncRecordValues(params: SyncRecordValuesParams): Promise<SyncRecordValuesResult>

Parameters:#

NameType
paramsSyncRecordValuesParams

Returns: Promise<SyncRecordValuesResult>

Defined in: src/Queries.ts:115


updateCacheIfNotPresent#

â–¸ updateCacheIfNotPresent(arg: UpdateCacheManuallyParam): Promise<void>

Parameters:#

NameType
argUpdateCacheManuallyParam

Returns: Promise<void>

Inherited from: Cache

Defined in: src/Cache.ts:96


updateCacheManually#

â–¸ updateCacheManually(arg: string | UpdateCacheManuallyParam): Promise<void>

Parameters:#

NameType
argstring | UpdateCacheManuallyParam

Returns: Promise<void>

Inherited from: Cache

Defined in: src/Cache.ts:82