queries
@nishans/endpoints / Exports / Queries
#
Class: QueriesA class containing all the api endpoints of Notion
noinheritdoc
#
Hierarchy#
Index#
Constructors#
Properties#
Methods- findUser
- getBacklinksForBlock
- getConfigs
- getGenericEmbedBlockData
- getGoogleDriveAccounts
- getJoinableSpaces
- getPageVisits
- getPublicPageData
- getPublicSpaceData
- getSpaces
- getSubscriptionData
- getTasks
- getUploadFileUrl
- getUserNotifications
- getUserSharedPages
- getUserTasks
- initializeCache
- initializeCacheForSpecificData
- isEmailEducation
- isUserDomainJoinable
- loadBlockSubtree
- loadPageChunk
- loadUserContent
- queryCollection
- recordPageVisit
- returnNonCachedData
- saveToCache
- syncRecordValues
- updateCacheIfNotPresent
- updateCacheManually
#
Constructors#
constructor+ new Queries(params
: Pick<CtorArgs, token | interval | user_id | cache>): Queries
#
Parameters:Name | Type |
---|---|
params | Pick<CtorArgs, token | interval | user_id | cache> |
Returns: Queries
Inherited from: Cache
Defined in: src/Queries.ts:52
#
Properties#
cache• cache: ICache
Defined in: src/Cache.ts:6
#
headers• headers: { headers
: { cookie
: string ; x-notion-active-user-header
: string } }
#
Type declaration:Name | Type |
---|---|
headers | { cookie : string ; x-notion-active-user-header : string } |
Defined in: src/Cache.ts:9
#
interval• interval: number
Inherited from: Cache.interval
Defined in: src/Cache.ts:8
#
token• token: string
Defined in: src/Cache.ts:7
#
user_id• user_id: string
Defined in: src/Cache.ts:15
#
Methods#
findUserâ–¸ findUser(params
: FindUserParams): Promise<FindUserResult>
#
Parameters:Name | Type |
---|---|
params | FindUserParams |
Returns: Promise<FindUserResult>
Defined in: src/Queries.ts:111
#
getBacklinksForBlockâ–¸ getBacklinksForBlock(params
: GetBackLinksForBlockParams): Promise<GetBackLinksForBlockResult>
#
Parameters:Name | Type |
---|---|
params | GetBackLinksForBlockParams |
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:Name | Type |
---|---|
arg | GetGenericEmbedBlockDataParams |
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:Name | Type |
---|---|
arg | GetPageVisitsParams |
Returns: Promise<GetPageVisitsResult>
Defined in: src/Queries.ts:57
#
getPublicPageDataâ–¸ getPublicPageData(arg
: GetPublicPageDataParams): Promise<GetPublicPageDataResult>
#
Parameters:Name | Type |
---|---|
arg | GetPublicPageDataParams |
Returns: Promise<GetPublicPageDataResult>
Defined in: src/Queries.ts:69
#
getPublicSpaceDataâ–¸ getPublicSpaceData(arg
: GetPublicSpaceDataParams): Promise<GetPublicSpaceDataResult>
#
Parameters:Name | Type |
---|---|
arg | GetPublicSpaceDataParams |
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:Name | Type |
---|---|
arg | GetSubscriptionDataParams |
Returns: Promise<GetSubscriptionDataResult>
Defined in: src/Queries.ts:77
#
getTasksâ–¸ getTasks(params
: GetTasksParams): Promise<GetTasksResult>
#
Parameters:Name | Type |
---|---|
params | GetTasksParams |
Returns: Promise<GetTasksResult>
Defined in: src/Queries.ts:155
#
getUploadFileUrlâ–¸ getUploadFileUrl(arg
: GetUploadFileUrlParams): Promise<GetUploadFileUrlResult>
#
Parameters:Name | Type |
---|---|
arg | GetUploadFileUrlParams |
Returns: Promise<GetUploadFileUrlResult>
Defined in: src/Queries.ts:97
#
getUserNotificationsâ–¸ getUserNotifications(params
: GetUserNotificationsParams): Promise<GetUserNotificationsResult>
#
Parameters:Name | Type |
---|---|
params | GetUserNotificationsParams |
Returns: Promise<GetUserNotificationsResult>
Defined in: src/Queries.ts:151
#
getUserSharedPagesâ–¸ getUserSharedPages(arg
: GetUserSharedPagesParams): Promise<GetUserSharedPagesResult>
#
Parameters:Name | Type |
---|---|
arg | GetUserSharedPagesParams |
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:Name | Type |
---|---|
id | string |
type | block | 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:Name | Type |
---|---|
arg | LoadBlockSubtreeParams |
Returns: Promise<LoadBlockSubtreeResult>
Defined in: src/Queries.ts:81
#
loadPageChunkâ–¸ loadPageChunk(params
: LoadPageChunkParams): Promise<LoadPageChunkResult>
#
Parameters:Name | Type |
---|---|
params | LoadPageChunkParams |
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:Name | Type |
---|---|
params | QueryCollectionParams |
Returns: Promise<QueryCollectionResult>
Defined in: src/Queries.ts:121
#
recordPageVisitâ–¸ recordPageVisit(params
: RecordPageVisitParams): Promise<GetPageVisitsResult>
#
Parameters:Name | Type |
---|---|
params | RecordPageVisitParams |
Returns: Promise<GetPageVisitsResult>
Defined in: src/Queries.ts:159
#
returnNonCachedDataâ–¸ returnNonCachedData(ids
: UpdateCacheManuallyParam): UpdateCacheManuallyParam
#
Parameters:Name | Type |
---|---|
ids | UpdateCacheManuallyParam |
Returns: UpdateCacheManuallyParam
Inherited from: Cache
Defined in: src/Cache.ts:60
#
saveToCacheâ–¸ saveToCache(recordMap
: Partial<RecordMap>): void
Save the passed recordMap to cache
#
Parameters:Name | Type | Description |
---|---|---|
recordMap | Partial<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:Name | Type |
---|---|
params | SyncRecordValuesParams |
Returns: Promise<SyncRecordValuesResult>
Defined in: src/Queries.ts:115
#
updateCacheIfNotPresentâ–¸ updateCacheIfNotPresent(arg
: UpdateCacheManuallyParam): Promise<void>
#
Parameters:Name | Type |
---|---|
arg | UpdateCacheManuallyParam |
Returns: Promise<void>
Inherited from: Cache
Defined in: src/Cache.ts:96
#
updateCacheManuallyâ–¸ updateCacheManually(arg
: string | UpdateCacheManuallyParam): Promise<void>
#
Parameters:Name | Type |
---|---|
arg | string | UpdateCacheManuallyParam |
Returns: Promise<void>
Inherited from: Cache
Defined in: src/Cache.ts:82