@dolittle/sdk.execution
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
59 lines • 2.5 kB
TypeScript
import { Guid } from '@dolittle/rudiments';
import { Version } from './Version';
import { MicroserviceId } from './MicroserviceId';
import { TenantId } from './TenantId';
import { Claims } from './Claims';
import { CorrelationId } from './CorrelationId';
import { Environment } from './Environment';
/**
* Represents the execution context in a running application.
*/
export declare class ExecutionContext {
private _microserviceId;
private _tenantId;
readonly version: Version;
readonly environment: Environment;
private _correlationId;
readonly claims: Claims;
/**
* Creates an instance of execution context.
* @param {MicroserviceId}_microserviceId - The microservice identifier.
* @param {TenantId} _tenantId - The current tenant identifier.
* @param {Version} version - The current version of the software.
* @param {string} environment - The current environment running in.
* @param {CorrelationId} _correlationId - The current correlation id for execution context being performed.
* @param {Claims} claims - The current claims for the context.
*/
constructor(_microserviceId: MicroserviceId, _tenantId: TenantId, version: Version, environment: Environment, _correlationId: CorrelationId, claims: Claims);
/**
* Gets the microservice identifier.
*/
get microserviceId(): MicroserviceId;
/**
* Gets the tenant identifier.
*/
get tenantId(): TenantId;
/**
* Gets the correlation identifier.
*/
get correlationId(): CorrelationId;
/**
* Creates a new execution context from the current with the provided tenant id.
* @param {TenantId | Guid | string} tenantId - The tenant id.
* @returns {ExecutionContext} The new execution context.
*/
forTenant(tenantId: TenantId | Guid | string): ExecutionContext;
/**
* Creates a new execution context from the current with the provided correlation id.
* @param {CorrelationId | Guid | string} correlationId - The correlation id.
* @returns {ExecutionContext} The new execution context.
*/
forCorrelation(correlationId: CorrelationId | Guid | string): ExecutionContext;
/**
* Creates a new execution context from the current with the provided claims.
* @param {Claims} claims - The claims.
* @returns {ExecutionContext} The new execution context.
*/
forClaims(claims: Claims): ExecutionContext;
}
//# sourceMappingURL=ExecutionContext.d.ts.map