default
@nishans/core / Exports / default
Class: default#
Hierarchy#
Cache
↳ default
Index#
Constructors#
Properties#
Methods#
- #initializeCache
- getNotionUser
- getNotionUsers
- initializeCache
- initializeCacheForSpecificData
- returnNonCachedData
- saveToCache
- updateCacheIfNotPresent
- updateCacheManually
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:#
| Name | Type |
|---|---|
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 } |
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:#
| Name | Type |
|---|---|
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:#
| Name | Type |
|---|---|
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:#
| Name | Type | Description |
|---|---|---|
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:#
| Name | Type |
|---|---|
id | string |
type | block | 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:#
| Name | Type |
|---|---|
ids | UpdateCacheManuallyParam |
Returns: UpdateCacheManuallyParam
Defined in: endpoints/dist/src/Cache.d.ts:21
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
Defined in: endpoints/dist/src/Cache.d.ts:20
updateCacheIfNotPresent#
â–¸ updateCacheIfNotPresent(arg: UpdateCacheManuallyParam): Promise<void>
Parameters:#
| Name | Type |
|---|---|
arg | UpdateCacheManuallyParam |
Returns: Promise<void>
Defined in: endpoints/dist/src/Cache.d.ts:24
updateCacheManually#
â–¸ updateCacheManually(arg: string | UpdateCacheManuallyParam): Promise<void>
Parameters:#
| Name | Type |
|---|---|
arg | string | UpdateCacheManuallyParam |
Returns: Promise<void>
Defined in: endpoints/dist/src/Cache.d.ts:23