default

@nishans/core / Exports / default

Class: default#

Hierarchy#

  • Cache

    ↳ default

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new default(arg: Pick<NishanArg, token> & { interval?: undefined | number ; logger?: undefined | false | (method: TMethodType, subject: block | collection | collection_view | space | notion_user | space_view | user_root | user_settings, id: string) => void }): default

Parameters:#

NameType
argPick<NishanArg, token> & { interval?: undefined | number ; logger?: undefined | false | (method: TMethodType, subject: block | collection | collection_view | space | notion_user | space_view | user_root | user_settings, id: string) => void }

Returns: default

Defined in: core/src/index.ts:26

Properties#

cache#

• cache: ICache

Defined in: endpoints/dist/src/Cache.d.ts:4


getConfigs#

• Protected getConfigs: () => Configs

Defined in: endpoints/dist/src/Cache.d.ts:15


headers#

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

Type declaration:#

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

Defined in: endpoints/dist/src/Cache.d.ts:7


init_cache#

• init_cache: boolean

Defined in: core/src/index.ts:25


interval#

• interval: number

Defined in: core/src/index.ts:24


logger#

• logger: Logger

Defined in: core/src/index.ts:26


token#

• token: string

Defined in: core/src/index.ts:23


user_id#

• user_id: string

Defined in: endpoints/dist/src/Cache.d.ts:13

Methods#

#initializeCache#

â–¸ #initializeCache(): Promise<void>

Returns: Promise<void>

Defined in: core/src/index.ts:38


getNotionUser#

â–¸ getNotionUser(arg?: FilterType<INotionUser>): Promise<NotionUser>

Get INotionUser and return NotionUser by the args param

Parameters:#

NameType
arg?FilterType<INotionUser>

Returns: Promise<NotionUser>

Defined in: core/src/index.ts:54


getNotionUsers#

â–¸ getNotionUsers(args?: FilterTypes<INotionUser>, multiple?: boolean): Promise<NotionUser[]>

Get INotionUser[] and return NotionUser[] by the args param

Parameters:#

NameTypeDescription
args?FilterTypes<INotionUser>An array of string ids, a predicate passed the INotionUser or undefined to indicate everything
multiple?boolean-

Returns: Promise<NotionUser[]>

Defined in: core/src/index.ts:62


initializeCache#

â–¸ initializeCache(): Promise<void>

Returns: Promise<void>

Defined in: endpoints/dist/src/Cache.d.ts:22


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>

Defined in: endpoints/dist/src/Cache.d.ts:25


returnNonCachedData#

â–¸ returnNonCachedData(ids: UpdateCacheManuallyParam): UpdateCacheManuallyParam

Parameters:#

NameType
idsUpdateCacheManuallyParam

Returns: UpdateCacheManuallyParam

Defined in: endpoints/dist/src/Cache.d.ts:21


saveToCache#

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

Save the passed recordMap to cache

Parameters:#

NameTypeDescription
recordMapPartial<RecordMap>RecordMap map to save to cache

Returns: void

Defined in: endpoints/dist/src/Cache.d.ts:20


updateCacheIfNotPresent#

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

Parameters:#

NameType
argUpdateCacheManuallyParam

Returns: Promise<void>

Defined in: endpoints/dist/src/Cache.d.ts:24


updateCacheManually#

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

Parameters:#

NameType
argstring | UpdateCacheManuallyParam

Returns: Promise<void>

Defined in: endpoints/dist/src/Cache.d.ts:23