Envelope
Constructors
makeRequest
Added in v1.0.0
Source
Signature
declare function makeRequest<Rpc extends Any>(options: {
readonly address: EntityAddress;
readonly headers: Headers;
readonly payload: Payload<Rpc>;
readonly requestId: Snowflake;
readonly sampled?: boolean;
readonly spanId?: string;
readonly tag: Tag<Rpc>;
readonly traceId?: string;
}): Request<Rpc>;Models
Signature
declare class AckChunk extends {
[key: string]: any;
} {
[key: string]: any;
constructor(...args: [props?: {
[key: string]: any;
}, options?: MakeOptions]);
readonly [TypeId]: typeof TypeId;
withRequestId(requestId: Snowflake): AckChunk;
}Signature
type Envelope<R extends Rpc.Any> = Request<R> | AckChunk | Interrupt;Signature
declare class Interrupt extends {
[key: string]: any;
} {
[key: string]: any;
constructor(...args: [props?: {
[key: string]: any;
}, options?: MakeOptions]);
readonly [TypeId]: typeof TypeId;
withRequestId(requestId: Snowflake): Interrupt;
}Signature
interface Request<in out Rpc extends Rpc.Any> {
readonly _tag: "Request";
readonly [TypeId]: typeof TypeId;
readonly address: EntityAddress;
readonly headers: Headers;
readonly payload: Payload<Rpc>;
readonly requestId: Snowflake;
readonly sampled?: boolean;
readonly spanId?: string;
readonly tag: Tag<Rpc>;
readonly traceId?: string;
}Other
Primary Key
primaryKey
Added in v1.0.0
Source
Signature
declare function primaryKey<R extends Any>(envelope: Envelope<R>): string | null;primaryKeyByAddress
Added in v1.0.0
Source
Signature
declare function primaryKeyByAddress(options: {
readonly address: EntityAddress;
readonly id: string;
readonly tag: string;
}): string;Refinements
isEnvelope
Added in v1.0.0
Source
Signature
declare function isEnvelope(u: unknown): u is Envelope<any>;Serialization / Deserialization
EnvelopeFromSelf
Added in v1.0.0
Source
Signature
declare const EnvelopeFromSelf: Schema.Schema<Envelope.Any, Envelope.Any>;PartialEncoded
Added in v1.0.0
Source
Signature
declare const PartialEncoded: Schema.Union<
[
Schema.Struct<{
_tag: Schema.Literal<["Request"]>;
address: typeof EntityAddress;
headers: Schema.Schema<Headers.Headers, ReadonlyRecord<string, string>>;
payload: typeof Schema.Unknown;
requestId: Schema.Schema<Snowflake, string>;
sampled: Schema.optional<typeof Schema.Boolean>;
spanId: Schema.optional<typeof Schema.String>;
tag: typeof Schema.String;
traceId: Schema.optional<typeof Schema.String>;
}>,
typeof AckChunk,
typeof Interrupt,
]
>;PartialEncodedArray
Added in v1.0.0
Source
Signature
declare const PartialEncodedArray: Schema.Schema<
Array<Envelope.PartialEncoded>,
Array<Envelope.Encoded>
>;PartialEncodedFromSelf
Added in v1.0.0
Source
Signature
declare const PartialEncodedFromSelf: Schema.Union<
[
Schema.Struct<{
_tag: Schema.Literal<["Request"]>;
address: Schema.Schema<EntityAddress>;
headers: Schema.Schema<Headers.Headers>;
payload: typeof Schema.Unknown;
requestId: Schema.Schema<Snowflake>;
sampled: Schema.optional<typeof Schema.Boolean>;
spanId: Schema.optional<typeof Schema.String>;
tag: typeof Schema.String;
traceId: Schema.optional<typeof Schema.String>;
}>,
Schema.Schema<AckChunk>,
Schema.Schema<Interrupt>,
]
>;PartialEncodedRequest
Added in v1.0.0
Source
Signature
declare const PartialEncodedRequest: Schema.Struct<{
_tag: Schema.Literal<["Request"]>;
address: typeof EntityAddress;
headers: Schema.Schema<Headers.Headers, ReadonlyRecord<string, string>>;
payload: typeof Schema.Unknown;
requestId: Schema.Schema<Snowflake, string>;
sampled: Schema.optional<typeof Schema.Boolean>;
spanId: Schema.optional<typeof Schema.String>;
tag: typeof Schema.String;
traceId: Schema.optional<typeof Schema.String>;
}>;PartialEncodedRequestFromSelf
Added in v1.0.0
Source
Signature
declare const PartialEncodedRequestFromSelf: Schema.Struct<{
_tag: Schema.Literal<["Request"]>;
address: Schema.Schema<EntityAddress>;
headers: Schema.Schema<Headers.Headers>;
payload: typeof Schema.Unknown;
requestId: Schema.Schema<Snowflake>;
sampled: Schema.optional<typeof Schema.Boolean>;
spanId: Schema.optional<typeof Schema.String>;
tag: typeof Schema.String;
traceId: Schema.optional<typeof Schema.String>;
}>;RequestFromSelf
Added in v1.0.0
Source
Signature
declare const RequestFromSelf: Schema.Schema<Request.Any, Request.Any>;