Envelope.ts overview
Since v1.0.0
Exports Grouped by Category
constructors
makeRequest
Signature
declare const makeRequest: <Rpc extends Rpc.Any>(options: {
readonly requestId: Snowflake
readonly address: EntityAddress
readonly tag: Rpc.Tag<Rpc>
readonly payload: Rpc.Payload<Rpc>
readonly headers: Headers.Headers
readonly traceId: string
readonly spanId: string
readonly sampled: boolean
}) => Request<Rpc>
Since v1.0.0
models
AckChunk (class)
Signature
declare class AckChunk
Since v1.0.0
withRequestId (method)
Signature
declare const withRequestId: (requestId: Snowflake) => AckChunk
Since v1.0.0
[TypeId] (property)
Signature
readonly [TypeId]: unique symbol
Since v1.0.0
Envelope (type alias)
Signature
type Envelope<R> = Request<R> | AckChunk | Interrupt
Since v1.0.0
Interrupt (class)
Signature
declare class Interrupt
Since v1.0.0
withRequestId (method)
Signature
declare const withRequestId: (requestId: Snowflake) => Interrupt
Since v1.0.0
[TypeId] (property)
Signature
readonly [TypeId]: unique symbol
Since v1.0.0
Request (interface)
Signature
export interface Request<in out Rpc extends Rpc.Any> {
readonly [TypeId]: TypeId
readonly _tag: "Request"
readonly requestId: Snowflake
readonly address: EntityAddress
readonly tag: Rpc.Tag<Rpc>
readonly payload: Rpc.Payload<Rpc>
readonly headers: Headers.Headers
readonly traceId: string
readonly spanId: string
readonly sampled: boolean
}
Since v1.0.0
primary key
primaryKey
Signature
declare const primaryKey: <R extends Rpc.Any>(envelope: Envelope<R>) => string | null
Since v1.0.0
refinements
isEnvelope
Signature
declare const isEnvelope: (u: unknown) => u is Envelope<any>
Since v1.0.0
serialization / deserialization
EnvelopeFromSelf
Signature
declare const EnvelopeFromSelf: Schema.Schema<Envelope.Any, Envelope.Any>
Since v1.0.0
PartialEncoded
Signature
declare const PartialEncoded: Schema.Union<
[
Schema.Struct<{
_tag: Schema.Literal<["Request"]>
requestId: Schema.Schema<Snowflake, string>
address: typeof EntityAddress
tag: typeof Schema.String
payload: typeof Schema.Unknown
headers: Schema.Schema<Headers.Headers, ReadonlyRecord<string, string>>
traceId: typeof Schema.String
spanId: typeof Schema.String
sampled: typeof Schema.Boolean
}>,
typeof AckChunk,
typeof Interrupt
]
>
Since v1.0.0
PartialEncodedArray
Signature
declare const PartialEncodedArray: Schema.Schema<Array<Envelope.PartialEncoded>, Array<any>>
Since v1.0.0
PartialEncodedFromSelf
Signature
declare const PartialEncodedFromSelf: Schema.Union<
[
Schema.Struct<{
_tag: Schema.Literal<["Request"]>
requestId: Schema.Schema<Snowflake>
address: Schema.Schema<EntityAddress>
tag: typeof Schema.String
payload: typeof Schema.Unknown
headers: Schema.Schema<Headers.Headers>
traceId: typeof Schema.String
spanId: typeof Schema.String
sampled: typeof Schema.Boolean
}>,
Schema.Schema<AckChunk>,
Schema.Schema<Interrupt>
]
>
Since v1.0.0
PartialEncodedRequest
Signature
declare const PartialEncodedRequest: Schema.Struct<{
_tag: Schema.Literal<["Request"]>
requestId: Schema.Schema<Snowflake, string>
address: typeof EntityAddress
tag: typeof Schema.String
payload: typeof Schema.Unknown
headers: Schema.Schema<Headers.Headers, ReadonlyRecord<string, string>>
traceId: typeof Schema.String
spanId: typeof Schema.String
sampled: typeof Schema.Boolean
}>
Since v1.0.0
PartialEncodedRequestFromSelf
Signature
declare const PartialEncodedRequestFromSelf: Schema.Struct<{
_tag: Schema.Literal<["Request"]>
requestId: Schema.Schema<Snowflake>
address: Schema.Schema<EntityAddress>
tag: typeof Schema.String
payload: typeof Schema.Unknown
headers: Schema.Schema<Headers.Headers>
traceId: typeof Schema.String
spanId: typeof Schema.String
sampled: typeof Schema.Boolean
}>
Since v1.0.0
RequestFromSelf
Signature
declare const RequestFromSelf: Schema.Schema<Request.Any, Request.Any>
Since v1.0.0
type ids
TypeId
Signature
declare const TypeId: unique symbol
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = typeof TypeId
Since v1.0.0
utils
Envelope (namespace)
Since v1.0.0
Any (type alias)
Signature
type Any = Envelope<any>
Since v1.0.0
Encoded (type alias)
Signature
type Encoded = Request.Encoded | typeof AckChunk.Encoded | typeof Interrupt.Encoded
Since v1.0.0
PartialEncoded (type alias)
Signature
type PartialEncoded = Request.PartialEncoded | AckChunk | Interrupt
Since v1.0.0
Request (namespace)
Since v1.0.0
Encoded (interface)
Signature
export interface Encoded {
readonly _tag: "Request"
readonly requestId: string
readonly address: typeof EntityAddress.Encoded
readonly tag: string
readonly payload: unknown
readonly headers: ReadonlyRecord<string, string>
readonly traceId: string
readonly spanId: string
readonly sampled: boolean
}
Since v1.0.0
PartialEncoded (interface)
Signature
export interface PartialEncoded {
readonly _tag: "Request"
readonly requestId: Snowflake
readonly address: EntityAddress
readonly tag: string
readonly payload: unknown
readonly headers: Headers.Headers
readonly traceId: string
readonly spanId: string
readonly sampled: boolean
}
Since v1.0.0
Any (type alias)
Signature
type Any = Request<any>
Since v1.0.0