Skip to content

Manager for getting object instances in Lambda contexts

License

Notifications You must be signed in to change notification settings

rhdeck/session-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@raydeck/session-manager - v1.4.0

@raydeck/session-manager - v1.4.0

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

LambdaFunctionType

Ƭ LambdaFunctionType: function

Defined in index.ts:87

Type declaration:

▸ (a: any, b?: any, c?: any): any

Parameters:

Name Type
a any
b? any
c? any

Variables

Let registry

registry: object

Defined in index.ts:19

Type declaration:


Const schemeRegistry

schemeRegistry: object

Defined in index.ts:18

Type declaration:

Functions

addClass

addClass(newClass: Schemable): Promise‹void›

Defined in index.ts:46

Add a scheme-able class to the session registry

Parameters:

Name Type Description
newClass Schemable Class -implementing static scheme property and getFromUri method - to add to the registry for lookups

Returns: Promise‹void›


flushSession

flushSession(): void

Defined in index.ts:84

Flush the session of cached files

Returns: void


getFromId

getFromIdT›(schemeOrClass: string | Schemable, id: string): Promise‹T›

Defined in index.ts:54

Retrieve from the registry, async to permit a load. Uses the class/scheme to limit the lookup

Type parameters:

T

Parameters:

Name Type Description
schemeOrClass string | Schemable Scheme (e.g. "myClass") or classname ("MyClass") to look up
id string id global within the class domain

Returns: Promise‹T›


getFromItem

getFromItemT›(schemeOrClass: string | Schemable, item: object): Promise‹T›

Defined in index.ts:25

Load an item based on map of data (usually from database)

Type parameters:

T

Parameters:

Name Type Description
schemeOrClass string | Schemable Scheme (e.g. "myClass") or classname ("MyClass") to look up
item object Map of attributes to load from

Returns: Promise‹T›


getFromUri

getFromUriT›(uri: string): Promise‹T›

Defined in index.ts:72

Retrieve from the registry, async to permit a load if it was not previously saved

Type parameters:

T

Parameters:

Name Type Description
uri string URI of object to retrieve

Returns: Promise‹T›


isCached

isCached(uri: string): boolean

Defined in index.ts:149

Determine if an object with this uri is already cached

Parameters:

Name Type Description
uri string

Returns: boolean


remove

remove(uri: string): void

Defined in index.ts:142

Removes an instance from the reistry by the uri

Parameters:

Name Type Description
uri string URI of the element to remove

Returns: void


set

set(o: Sessionable): void

Defined in index.ts:134

Save an object instance to the session registry

Parameters:

Name Type Description
o Sessionable instance to save in registry

Returns: void


withBatch

withBatch(f: LambdaFunctionType): (Anonymous function)

Defined in index.ts:104

Wraps a function to be used in a AWS Appsync Batch invocation

Parameters:

Name Type Description
f LambdaFunctionType function to wrap

Returns: (Anonymous function)


Const withSession

withSession(f: LambdaFunctionType): (Anonymous function)

Defined in index.ts:92

Wraps a function to guarantee a new session before it runs

Parameters:

Name Type Description
f LambdaFunctionType function to wrap

Returns: (Anonymous function)

@raydeck/session-manager - v1.4.0Schemable

Interface: Schemable

Interface for static elements on a class

Hierarchy

  • Schemable

Index

Properties

Methods

Properties

Optional getFromItem

getFromItem? : undefined | function

Defined in index.ts:10


Optional idToUri

idToUri? : undefined | function

Defined in index.ts:8


scheme

scheme: string

Defined in index.ts:6

Methods

get

get(id: string): Promise‹Sessionable

Defined in index.ts:9

Parameters:

Name Type
id string

Returns: Promise‹Sessionable


getFromUri

getFromUri(uri: string): Promise‹Sessionable

Defined in index.ts:7

Parameters:

Name Type
uri string

Returns: Promise‹Sessionable

@raydeck/session-manager - v1.4.0Sessionable

Interface: Sessionable

Interface for instance elements on a class. (Much simpler requirement)

Hierarchy

  • Sessionable

Index

Methods

Methods

getUri

getUri(): string

Defined in index.ts:16

Returns: string

About

Manager for getting object instances in Lambda contexts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published