GlobalContext
Class: GlobalContext
Defined in: packages/core/src/contexts/globalcontext.ts:7
Global Context is used as system context
Extends
Constructors
Constructor
new GlobalContext():
GlobalContext
Returns
GlobalContext
Inherited from
Properties
_promises
_promises:
Promise<any>[]
Defined in: packages/core/src/contexts/icontext.ts:33
Contain all registered promises to this context
Inherited from
caches
caches:
any
Defined in: packages/core/src/contexts/icontext.ts:19
Get the caches linked to the context
Inherited from
extensions
protectedextensions:object
Defined in: packages/core/src/contexts/icontext.ts:23
Allow extensions
Index Signature
[key: string]: any
Inherited from
flushed
protectedflushed:boolean=false
Defined in: packages/core/src/contexts/icontext.ts:37
If the headers were flushed
Inherited from
Methods
end()
end():
Promise<void>
Defined in: packages/core/src/contexts/icontext.ts:80
Ensure the whole execution is finished
Returns
Promise<void>
Inherited from
flushHeaders()
flushHeaders():
Promise<void>
Defined in: packages/core/src/contexts/icontext.ts:134
Send the headers to the client
Returns
Promise<void>
Inherited from
getCurrentUser()
getCurrentUser():
Promise<undefined>
Defined in: packages/core/src/contexts/globalcontext.ts:32
Returns
Promise<undefined>
Overrides
getCurrentUserId()
getCurrentUserId():
string
Defined in: packages/core/src/contexts/globalcontext.ts:18
Returns
string
Overrides
getExtension()
getExtension<
K>(name):K
Defined in: packages/core/src/contexts/icontext.ts:64
Get an extension of the context
Type Parameters
K
K = any
Parameters
name
string
of the extension
Returns
K
extension object
Inherited from
getOutputStream()
getOutputStream():
Promise<Writable>
Defined in: packages/core/src/contexts/globalcontext.ts:11
Returns
Promise<Writable>
Overrides
getResponseHeaders()
getResponseHeaders():
any
Defined in: packages/core/src/contexts/icontext.ts:127
Get current response headers
Returns
any
the result
Inherited from
getSession()
getSession():
object
Defined in: packages/core/src/contexts/globalcontext.ts:40
Provide an empty session object
Returns
object
the result
Overrides
init()
init():
Promise<GlobalContext>
Defined in: packages/core/src/contexts/icontext.ts:96
Can be used to init the context if needed Reading from the input or reaching to a db
Returns
Promise<GlobalContext>
this for chaining
Inherited from
isGlobalContext()
isGlobalContext():
boolean
Defined in: packages/core/src/contexts/globalcontext.ts:25
Returns
boolean
Overrides
pipeline()
pipeline(
stream1, ...streams):Promise<void>
Defined in: packages/core/src/contexts/icontext.ts:149
Pipeline streams into the output stream
Parameters
stream1
ReadableStream
the first stream
streams
...(ReadWriteStream | PipelineOptions)[]
additional streams
Returns
Promise<void>
See
https://nodejs.org/api/stream.html#streampipelinestreams-options
Inherited from
registerPromise()
registerPromise(
promise):void
Defined in: packages/core/src/contexts/icontext.ts:56
Register a promise with the context
Parameters
promise
any
the promise to add
Returns
void
Inherited from
setExtension()
setExtension(
name,extension):this
Defined in: packages/core/src/contexts/icontext.ts:73
Parameters
name
string
to add
extension
any
object to store
Returns
this
this for chaining
Inherited from
setHeader()
setHeader(
name,value):void
Defined in: packages/core/src/contexts/icontext.ts:104
Set a header in the response
Parameters
name
string
the name to use
value
string | number | string[]
the value to set
Returns
void
Inherited from
writeHead()
writeHead(
_code,headers):void
Defined in: packages/core/src/contexts/icontext.ts:116
For easier compatibility with WebContext On OperationContext this call is simply ignored
Parameters
_code
number
the status code
headers
Returns
void