Skip to content

@nestarc/outbox ​

Classes ​

LocalTransport ​

Defined in: src/transports/local.transport.ts:10

Implements ​

Constructors ​

Constructor ​
ts
new LocalTransport(tenantProvider?): LocalTransport;

Defined in: src/transports/local.transport.ts:11

Parameters ​
ParameterType
tenantProvider?OutboxTenantProvider | null
Returns ​

LocalTransport

Methods ​

dispatch() ​
ts
dispatch(
   record,
   handlers,
context?): Promise<void>;

Defined in: src/transports/local.transport.ts:17

Parameters ​
ParameterType
recordOutboxRecord
handlersOutboxHandler[]
contextOutboxHandlerContext
Returns ​

Promise<void>

Implementation of ​

OutboxTransport.dispatch


OutboxAdminService ​

Defined in: src/outbox.admin.service.ts:613

Privileged global outbox control-plane access. The package does not perform caller authentication or RBAC for this service.

Extends ​

Constructors ​

Constructor ​
ts
new OutboxAdminService(options): OutboxAdminService;

Defined in: src/outbox.admin.service.ts:614

Parameters ​
ParameterType
optionsOutboxOptions
Returns ​

OutboxAdminService

Overrides ​
ts
OutboxAdminBase<OutboxListOptions>.constructor

Methods ​

getById() ​
ts
getById(id): Promise<OutboxRecord | null>;

Defined in: src/outbox.admin.service.ts:254

Parameters ​
ParameterType
idstring
Returns ​

Promise<OutboxRecord | null>

Inherited from ​
ts
OutboxAdminBase.getById

getHealth() ​
ts
getHealth(options?): Promise<OutboxHealth>;

Defined in: src/outbox.admin.service.ts:463

Parameters ​
ParameterType
optionsOutboxHealthOptions
Returns ​

Promise<OutboxHealth>

Inherited from ​
ts
OutboxAdminBase.getHealth

getStats() ​
ts
getStats(): Promise<OutboxStats>;

Defined in: src/outbox.admin.service.ts:71

Returns ​

Promise<OutboxStats>

Inherited from ​
ts
OutboxAdminBase.getStats

list() ​
ts
list(options?): Promise<OutboxRecord[]>;

Defined in: src/outbox.admin.service.ts:126

Parameters ​
ParameterType
optionsOutboxListOptions
Returns ​

Promise<OutboxRecord[]>

Inherited from ​
ts
OutboxAdminBase.list

listPage() ​
ts
listPage(options?): Promise<OutboxListPage>;

Defined in: src/outbox.admin.service.ts:184

Deterministic descending pagination. The cursor is an opaque, versioned, exclusive boundary over (created_at, id).

Parameters ​
ParameterType
optionsOutboxListOptions & { cursor?: string; }
Returns ​

Promise<OutboxListPage>

Inherited from ​
ts
OutboxAdminBase.listPage

markFailed() ​
ts
markFailed(id, reason): Promise<OutboxAdminMutationResult>;

Defined in: src/outbox.admin.service.ts:375

Parameters ​
ParameterType
idstring
reasonstring
Returns ​

Promise<OutboxAdminMutationResult>

Inherited from ​
ts
OutboxAdminBase.markFailed

purgeSent() ​
ts
purgeSent(options): Promise<number>;

Defined in: src/outbox.admin.service.ts:432

Parameters ​
ParameterType
options{ before: Date; limit?: number; }
options.beforeDate
options.limit?number
Returns ​

Promise<number>

Inherited from ​
ts
OutboxAdminBase.purgeSent

retry() ​
ts
retry(id): Promise<OutboxAdminMutationResult>;

Defined in: src/outbox.admin.service.ts:275

Parameters ​
ParameterType
idstring
Returns ​

Promise<OutboxAdminMutationResult>

Inherited from ​
ts
OutboxAdminBase.retry

retryMany() ​
ts
retryMany(ids): Promise<number>;

Defined in: src/outbox.admin.service.ts:329

Parameters ​
ParameterType
idsstring[]
Returns ​

Promise<number>

Inherited from ​
ts
OutboxAdminBase.retryMany

OutboxConfigurationError ​

Defined in: src/errors/outbox-configuration.error.ts:3

Extends ​

  • Error

Constructors ​

Constructor ​
ts
new OutboxConfigurationError(option, message): OutboxConfigurationError;

Defined in: src/errors/outbox-configuration.error.ts:6

Parameters ​
ParameterType
optionstring
messagestring
Returns ​

OutboxConfigurationError

Overrides ​
ts
Error.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​
ts
Error.cause

code ​
ts
readonly code: "OUTBOX_INVALID_CONFIGURATION" = OUTBOX_INVALID_CONFIGURATION;

Defined in: src/errors/outbox-configuration.error.ts:4

message ​
ts
message: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​
ts
Error.message

name ​
ts
name: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​
ts
Error.name

option ​
ts
readonly option: string;

Defined in: src/errors/outbox-configuration.error.ts:7

stack? ​
ts
optional stack?: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​
ts
Error.stack

stackTraceLimit ​
ts
static stackTraceLimit: number;

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​
ts
Error.stackTraceLimit

Methods ​

captureStackTrace() ​
ts
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
ParameterType
targetObjectobject
constructorOpt?Function
Returns ​

void

Inherited from ​
ts
Error.captureStackTrace

prepareStackTrace() ​
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters ​
ParameterType
errError
stackTracesCallSite[]
Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​
ts
Error.prepareStackTrace

OutboxCursorError ​

Defined in: src/errors/outbox-cursor.error.ts:4

Stable admin pagination error for malformed or unsupported cursors.

Extends ​

  • Error

Constructors ​

Constructor ​
ts
new OutboxCursorError(message?): OutboxCursorError;

Defined in: src/errors/outbox-cursor.error.ts:7

Parameters ​
ParameterTypeDefault value
messagestring'Outbox cursor is malformed or unsupported'
Returns ​

OutboxCursorError

Overrides ​
ts
Error.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​
ts
Error.cause

code ​
ts
readonly code: "OUTBOX_INVALID_CURSOR" = OUTBOX_INVALID_CURSOR;

Defined in: src/errors/outbox-cursor.error.ts:5

message ​
ts
message: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​
ts
Error.message

name ​
ts
name: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​
ts
Error.name

stack? ​
ts
optional stack?: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​
ts
Error.stack

stackTraceLimit ​
ts
static stackTraceLimit: number;

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​
ts
Error.stackTraceLimit

Methods ​

captureStackTrace() ​
ts
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
ParameterType
targetObjectobject
constructorOpt?Function
Returns ​

void

Inherited from ​
ts
Error.captureStackTrace

prepareStackTrace() ​
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters ​
ParameterType
errError
stackTracesCallSite[]
Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​
ts
Error.prepareStackTrace

OutboxEmitter ​

Defined in: src/outbox.emitter.ts:52

Constructors ​

Constructor ​
ts
new OutboxEmitter(options, tenantProvider?): OutboxEmitter;

Defined in: src/outbox.emitter.ts:56

Parameters ​
ParameterType
optionsOutboxOptions
tenantProvider?OutboxTenantProvider | null
Returns ​

OutboxEmitter

Methods ​

emit() ​
ts
emit(
   tx,
   event,
options?): Promise<void>;

Defined in: src/outbox.emitter.ts:65

Parameters ​
ParameterType
txPrismaTransactionClient
eventOutboxEvent
options?OutboxEmitOptions
Returns ​

Promise<void>

emitMany() ​
ts
emitMany(tx, events): Promise<void>;

Defined in: src/outbox.emitter.ts:78

Parameters ​
ParameterType
txPrismaTransactionClient
eventsOutboxEmitManyEntry[]
Returns ​

Promise<void>


OutboxEnvelopeError ​

Defined in: src/errors/outbox-envelope.error.ts:14

Stable producer-side validation error thrown before any database call.

Extends ​

  • Error

Constructors ​

Constructor ​
ts
new OutboxEnvelopeError(
   field,
   reason,
   message): OutboxEnvelopeError;

Defined in: src/errors/outbox-envelope.error.ts:17

Parameters ​
ParameterType
fieldstring
reasonOutboxEnvelopeErrorReason
messagestring
Returns ​

OutboxEnvelopeError

Overrides ​
ts
Error.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​
ts
Error.cause

code ​
ts
readonly code: "OUTBOX_INVALID_ENVELOPE" = OUTBOX_INVALID_ENVELOPE;

Defined in: src/errors/outbox-envelope.error.ts:15

field ​
ts
readonly field: string;

Defined in: src/errors/outbox-envelope.error.ts:18

message ​
ts
message: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​
ts
Error.message

name ​
ts
name: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​
ts
Error.name

reason ​
ts
readonly reason: OutboxEnvelopeErrorReason;

Defined in: src/errors/outbox-envelope.error.ts:19

stack? ​
ts
optional stack?: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​
ts
Error.stack

stackTraceLimit ​
ts
static stackTraceLimit: number;

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​
ts
Error.stackTraceLimit

Methods ​

captureStackTrace() ​
ts
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
ParameterType
targetObjectobject
constructorOpt?Function
Returns ​

void

Inherited from ​
ts
Error.captureStackTrace

prepareStackTrace() ​
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters ​
ParameterType
errError
stackTracesCallSite[]
Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​
ts
Error.prepareStackTrace

abstract OutboxEvent ​

Defined in: src/outbox.event.ts:1

Constructors ​

Constructor ​
ts
new OutboxEvent(): OutboxEvent;
Returns ​

OutboxEvent

Methods ​

getEventType() ​
ts
getEventType(): string;

Defined in: src/outbox.event.ts:10

Returns ​

string

toPayload() ​
ts
toPayload(): Record<string, unknown>;

Defined in: src/outbox.event.ts:2

Returns ​

Record<string, unknown>


OutboxListener ​

Defined in: src/outbox.listener.ts:39

Implements ​

  • OnModuleInit
  • OnApplicationShutdown

Constructors ​

Constructor ​
ts
new OutboxListener(
   options,
   poller,
   schemaGuard?): OutboxListener;

Defined in: src/outbox.listener.ts:49

Parameters ​
ParameterType
optionsOutboxOptions
pollerPick<OutboxPoller, "requestPoll">
schemaGuard?OutboxSchemaGuard
Returns ​

OutboxListener

Methods ​

onApplicationShutdown() ​
ts
onApplicationShutdown(): Promise<void>;

Defined in: src/outbox.listener.ts:83

Returns ​

Promise<void>

Implementation of ​
ts
OnApplicationShutdown.onApplicationShutdown

onModuleInit() ​
ts
onModuleInit(): Promise<void>;

Defined in: src/outbox.listener.ts:56

Returns ​

Promise<void>

Implementation of ​
ts
OnModuleInit.onModuleInit

OutboxModule ​

Defined in: src/outbox.module.ts:34

Constructors ​

Constructor ​
ts
new OutboxModule(): OutboxModule;
Returns ​

OutboxModule

Methods ​

forRoot() ​
ts
static forRoot(options): DynamicModule;

Defined in: src/outbox.module.ts:35

Parameters ​
ParameterType
optionsOutboxOptions
Returns ​

DynamicModule

forRootAsync() ​
ts
static forRootAsync(options): DynamicModule;

Defined in: src/outbox.module.ts:87

Parameters ​
ParameterType
optionsOutboxAsyncOptions
Returns ​

DynamicModule


OutboxPersistedInvariantError ​

Defined in: src/errors/outbox-persisted-invariant.error.ts:4

Extends ​

  • Error

Constructors ​

Constructor ​
ts
new OutboxPersistedInvariantError(
   eventId,
   field,
   message): OutboxPersistedInvariantError;

Defined in: src/errors/outbox-persisted-invariant.error.ts:7

Parameters ​
ParameterType
eventIdstring | null
fieldstring
messagestring
Returns ​

OutboxPersistedInvariantError

Overrides ​
ts
Error.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​
ts
Error.cause

code ​
ts
readonly code: "OUTBOX_PERSISTED_INVARIANT_VIOLATION" = OUTBOX_PERSISTED_INVARIANT_VIOLATION;

Defined in: src/errors/outbox-persisted-invariant.error.ts:5

eventId ​
ts
readonly eventId: string | null;

Defined in: src/errors/outbox-persisted-invariant.error.ts:8

field ​
ts
readonly field: string;

Defined in: src/errors/outbox-persisted-invariant.error.ts:9

message ​
ts
message: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​
ts
Error.message

name ​
ts
name: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​
ts
Error.name

stack? ​
ts
optional stack?: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​
ts
Error.stack

stackTraceLimit ​
ts
static stackTraceLimit: number;

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​
ts
Error.stackTraceLimit

Methods ​

captureStackTrace() ​
ts
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
ParameterType
targetObjectobject
constructorOpt?Function
Returns ​

void

Inherited from ​
ts
Error.captureStackTrace

prepareStackTrace() ​
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters ​
ParameterType
errError
stackTracesCallSite[]
Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​
ts
Error.prepareStackTrace

OutboxSchemaError ​

Defined in: src/errors/outbox-schema.error.ts:3

Extends ​

  • Error

Constructors ​

Constructor ​
ts
new OutboxSchemaError(
   requiredVersion,
   actualVersion,
   missing): OutboxSchemaError;

Defined in: src/errors/outbox-schema.error.ts:7

Parameters ​
ParameterType
requiredVersionstring
actualVersionstring
missingreadonly string[]
Returns ​

OutboxSchemaError

Overrides ​
ts
Error.constructor

Properties ​

actualVersion ​
ts
readonly actualVersion: string;

Defined in: src/errors/outbox-schema.error.ts:9

cause? ​
ts
optional cause?: unknown;

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​
ts
Error.cause

code ​
ts
readonly code: "OUTBOX_SCHEMA_MISMATCH" = OUTBOX_SCHEMA_MISMATCH;

Defined in: src/errors/outbox-schema.error.ts:5

message ​
ts
message: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​
ts
Error.message

missing ​
ts
readonly missing: readonly string[];

Defined in: src/errors/outbox-schema.error.ts:10

name ​
ts
readonly name: "OutboxSchemaError" = 'OutboxSchemaError';

Defined in: src/errors/outbox-schema.error.ts:4

Overrides ​
ts
Error.name

requiredVersion ​
ts
readonly requiredVersion: string;

Defined in: src/errors/outbox-schema.error.ts:8

stack? ​
ts
optional stack?: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​
ts
Error.stack

stackTraceLimit ​
ts
static stackTraceLimit: number;

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​
ts
Error.stackTraceLimit

Methods ​

captureStackTrace() ​
ts
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
ParameterType
targetObjectobject
constructorOpt?Function
Returns ​

void

Inherited from ​
ts
Error.captureStackTrace

prepareStackTrace() ​
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters ​
ParameterType
errError
stackTracesCallSite[]
Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​
ts
Error.prepareStackTrace

OutboxTenantAdminService ​

Defined in: src/outbox.admin.service.ts:636

Creates an outbox admin API whose every query is fenced by one expected tenant id. The caller remains responsible for authorizing that identity.

Constructors ​

Constructor ​
ts
new OutboxTenantAdminService(options): OutboxTenantAdminService;

Defined in: src/outbox.admin.service.ts:637

Parameters ​
ParameterType
optionsOutboxOptions
Returns ​

OutboxTenantAdminService

Methods ​

forTenant() ​
ts
forTenant(expectedTenantId): OutboxTenantAdminScope;

Defined in: src/outbox.admin.service.ts:641

Parameters ​
ParameterType
expectedTenantIdstring
Returns ​

OutboxTenantAdminScope


OutboxWakeupUnavailableError ​

Defined in: src/errors/outbox-wakeup-unavailable.error.ts:7

Raised during module initialization when both the polling scheduler and the PostgreSQL wakeup transport are unavailable.

Extends ​

  • Error

Constructors ​

Constructor ​
ts
new OutboxWakeupUnavailableError(cause): OutboxWakeupUnavailableError;

Defined in: src/errors/outbox-wakeup-unavailable.error.ts:10

Parameters ​
ParameterType
causeError
Returns ​

OutboxWakeupUnavailableError

Overrides ​
ts
Error.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​
ts
Error.cause

code ​
ts
readonly code: "OUTBOX_WAKEUP_UNAVAILABLE" = OUTBOX_WAKEUP_UNAVAILABLE;

Defined in: src/errors/outbox-wakeup-unavailable.error.ts:8

message ​
ts
message: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from ​
ts
Error.message

name ​
ts
name: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​
ts
Error.name

stack? ​
ts
optional stack?: string;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​
ts
Error.stack

stackTraceLimit ​
ts
static stackTraceLimit: number;

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from ​
ts
Error.stackTraceLimit

Methods ​

captureStackTrace() ​
ts
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters ​
ParameterType
targetObjectobject
constructorOpt?Function
Returns ​

void

Inherited from ​
ts
Error.captureStackTrace

prepareStackTrace() ​
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters ​
ParameterType
errError
stackTracesCallSite[]
Returns ​

any

See ​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from ​
ts
Error.prepareStackTrace

Interfaces ​

OutboxAsyncOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:75

Extends ​

  • Pick<ModuleMetadata, "imports">

Properties ​

imports? ​
ts
optional imports?: (
  | DynamicModule
  | Type<any>
  | Promise<DynamicModule>
  | ForwardReference<any>)[];

Defined in: node_modules/@nestjs/common/interfaces/modules/module-metadata.interface.d.ts:18

Optional list of imported modules that export the providers which are required in this module.

Inherited from ​
ts
Pick.imports

inject? ​
ts
optional inject?: any[];

Defined in: src/interfaces/outbox-options.interface.ts:76

isGlobal? ​
ts
optional isGlobal?: boolean;

Defined in: src/interfaces/outbox-options.interface.ts:86

tenantProvider? ​
ts
optional tenantProvider?:
  | OutboxTenantProvider
| Type<OutboxTenantProvider>;

Defined in: src/interfaces/outbox-options.interface.ts:85

Nest-created tenant provider class or an already-created provider value.

transport? ​
ts
optional transport?: Type<
  | OutboxTransport
| OutboxPublisher>;

Defined in: src/interfaces/outbox-options.interface.ts:83

Nest-created custom transport class. Defaults to LocalTransport.

useClass? ​
ts
optional useClass?: Type<OutboxOptionsFactory>;

Defined in: src/interfaces/outbox-options.interface.ts:80

useExisting? ​
ts
optional useExisting?: Type<OutboxOptionsFactory>;

Defined in: src/interfaces/outbox-options.interface.ts:81

useFactory? ​
ts
optional useFactory?: (...args) =>
  | OutboxAsyncRuntimeOptions
| Promise<OutboxAsyncRuntimeOptions>;

Defined in: src/interfaces/outbox-options.interface.ts:77

Parameters ​
ParameterType
...argsany[]
Returns ​

| OutboxAsyncRuntimeOptions | Promise<OutboxAsyncRuntimeOptions>


OutboxAsyncRuntimeOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:66

Runtime values produced by an async options factory. Nest provider registrations are intentionally owned by OutboxAsyncOptions so their dependencies can participate in the module graph before the factory resolves.

Extends ​

Properties ​

delivery? ​
ts
optional delivery?: OutboxDeliveryOptions;

Defined in: src/interfaces/outbox-options.interface.ts:49

Inherited from ​

OutboxOptions.delivery

events? ​
ts
optional events?: Type<any>[];

Defined in: src/interfaces/outbox-options.interface.ts:54

Inherited from ​

OutboxOptions.events

hooks? ​
ts
optional hooks?: OutboxHooks;

Defined in: src/interfaces/outbox-options.interface.ts:51

Inherited from ​

OutboxOptions.hooks

isGlobal? ​
ts
optional isGlobal?: undefined;

Defined in: src/interfaces/outbox-options.interface.ts:71

lease? ​
ts
optional lease?: OutboxLeaseOptions;

Defined in: src/interfaces/outbox-options.interface.ts:53

Inherited from ​

OutboxOptions.lease

polling? ​
ts
optional polling?: OutboxPollingOptions;

Defined in: src/interfaces/outbox-options.interface.ts:45

Inherited from ​

OutboxOptions.polling

prisma ​
ts
prisma: any;

Defined in: src/interfaces/outbox-options.interface.ts:44

forRoot: PrismaService class reference (resolved via DI, must be in a

Global ​

module). forRootAsync: resolved PrismaService instance from the factory. The instance must satisfy PrismaLike ($executeRaw, $queryRaw).

Inherited from ​

OutboxOptions.prisma

retry? ​
ts
optional retry?: OutboxRetryOptions;

Defined in: src/interfaces/outbox-options.interface.ts:46

Inherited from ​

OutboxOptions.retry

stuckThreshold? ​
ts
optional stuckThreshold?: number;

Defined in: src/interfaces/outbox-options.interface.ts:57

Deprecated ​

Use lease.duration. Retained as a lease-duration compatibility alias.

Inherited from ​

OutboxOptions.stuckThreshold

tenancy? ​
ts
optional tenancy?: Omit<OutboxTenancyOptions, "provider"> & {
  provider?: undefined;
};

Defined in: src/interfaces/outbox-options.interface.ts:70

Type Declaration ​
provider? ​
ts
optional provider?: undefined;

transport? ​
ts
optional transport?: undefined;

Defined in: src/interfaces/outbox-options.interface.ts:72

wakeup? ​
ts
optional wakeup?: OutboxWakeupOptions;

Defined in: src/interfaces/outbox-options.interface.ts:52

Inherited from ​

OutboxOptions.wakeup


OutboxDeliveryOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:25

Properties ​

mode? ​
ts
optional mode?: "local" | "publisher";

Defined in: src/interfaces/outbox-options.interface.ts:26


OutboxDispatchContext ​

Defined in: src/interfaces/outbox-hooks.interface.ts:22

Extended by ​

Properties ​

aggregateId ​
ts
readonly aggregateId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:30

aggregateType ​
ts
readonly aggregateType: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:29

causationId ​
ts
readonly causationId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:34

correlationId ​
ts
readonly correlationId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:33

eventId ​
ts
readonly eventId: string;

Defined in: src/interfaces/outbox-hooks.interface.ts:24

eventType ​
ts
readonly eventType: string;

Defined in: src/interfaces/outbox-hooks.interface.ts:25

headers ​
ts
readonly headers: Readonly<Record<string, string>>;

Defined in: src/interfaces/outbox-hooks.interface.ts:35

idempotencyKey ​
ts
readonly idempotencyKey: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:32

maxRetries ​
ts
readonly maxRetries: number;

Defined in: src/interfaces/outbox-hooks.interface.ts:28

partitionKey ​
ts
readonly partitionKey: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:31

record ​
ts
readonly record: OutboxRecord;

Defined in: src/interfaces/outbox-hooks.interface.ts:23

retryCount ​
ts
readonly retryCount: number;

Defined in: src/interfaces/outbox-hooks.interface.ts:27

tenantId ​
ts
readonly tenantId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:26


OutboxEmitContext ​

Defined in: src/interfaces/outbox-hooks.interface.ts:3

Properties ​

aggregateId ​
ts
readonly aggregateId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:8

aggregateType ​
ts
readonly aggregateType: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:7

causationId ​
ts
readonly causationId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:12

correlationId ​
ts
readonly correlationId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:11

eventType ​
ts
readonly eventType: string;

Defined in: src/interfaces/outbox-hooks.interface.ts:4

headers ​
ts
readonly headers: Readonly<Record<string, string>>;

Defined in: src/interfaces/outbox-hooks.interface.ts:13

idempotencyKey ​
ts
readonly idempotencyKey: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:10

occurredAt ​
ts
readonly occurredAt: Date | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:14

partitionKey ​
ts
readonly partitionKey: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:9

payload ​
ts
readonly payload: Readonly<Record<string, unknown>>;

Defined in: src/interfaces/outbox-hooks.interface.ts:5

tenantId ​
ts
readonly tenantId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:6


OutboxHandler ​

Defined in: src/interfaces/outbox-handler.interface.ts:1

Properties ​

eventTypes ​
ts
eventTypes: string[];

Defined in: src/interfaces/outbox-handler.interface.ts:4

instance ​
ts
instance: Record<string, any>;

Defined in: src/interfaces/outbox-handler.interface.ts:2

methodName ​
ts
methodName: string;

Defined in: src/interfaces/outbox-handler.interface.ts:3


OutboxHandlerContext ​

Defined in: src/interfaces/outbox-handler-context.interface.ts:3

Properties ​

eventId ​
ts
readonly eventId: string;

Defined in: src/interfaces/outbox-handler-context.interface.ts:5

eventType ​
ts
readonly eventType: string;

Defined in: src/interfaces/outbox-handler-context.interface.ts:6

headers ​
ts
readonly headers: Readonly<Record<string, string>>;

Defined in: src/interfaces/outbox-handler-context.interface.ts:9

record ​
ts
readonly record: OutboxRecord;

Defined in: src/interfaces/outbox-handler-context.interface.ts:4

retryCount ​
ts
readonly retryCount: number;

Defined in: src/interfaces/outbox-handler-context.interface.ts:8

tenantId ​
ts
readonly tenantId: string | null;

Defined in: src/interfaces/outbox-handler-context.interface.ts:7


OutboxHealth ​

Defined in: src/interfaces/outbox-admin.interface.ts:40

Properties ​

ok ​
ts
ok: boolean;

Defined in: src/interfaces/outbox-admin.interface.ts:41

reasons ​
ts
reasons: string[];

Defined in: src/interfaces/outbox-admin.interface.ts:43

stats ​
ts
stats: OutboxStats;

Defined in: src/interfaces/outbox-admin.interface.ts:42


OutboxHealthOptions ​

Defined in: src/interfaces/outbox-admin.interface.ts:35

Properties ​

maxFailedCount? ​
ts
optional maxFailedCount?: number;

Defined in: src/interfaces/outbox-admin.interface.ts:37

maxOldestPendingAgeMs? ​
ts
optional maxOldestPendingAgeMs?: number;

Defined in: src/interfaces/outbox-admin.interface.ts:36


OutboxHooks ​

Defined in: src/interfaces/outbox-hooks.interface.ts:44

Methods ​

onDeadLetter()? ​
ts
optional onDeadLetter(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:58

Parameters ​
ParameterType
contextOutboxRetryContext
Returns ​

void | Promise<void>

onDispatchFailure()? ​
ts
optional onDispatchFailure(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:51

Parameters ​
ParameterType
contextOutboxDispatchContext & { durationMs: number; error: Error; }
Returns ​

void | Promise<void>

onDispatchStart()? ​
ts
optional onDispatchStart(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:47

Parameters ​
ParameterType
contextOutboxDispatchContext
Returns ​

void | Promise<void>

onDispatchSuccess()? ​
ts
optional onDispatchSuccess(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:48

Parameters ​
ParameterType
contextOutboxDispatchContext & { durationMs: number; }
Returns ​

void | Promise<void>

onEmit()? ​
ts
optional onEmit(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:45

Parameters ​
ParameterType
contextOutboxEmitContext
Returns ​

void | Promise<void>

onPollStart()? ​
ts
optional onPollStart(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:46

Parameters ​
ParameterType
contextOutboxPollContext
Returns ​

void | Promise<void>

onRetryScheduled()? ​
ts
optional onRetryScheduled(context): void | Promise<void>;

Defined in: src/interfaces/outbox-hooks.interface.ts:57

Parameters ​
ParameterType
contextOutboxRetryContext
Returns ​

void | Promise<void>


OutboxLeaseOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:29

Properties ​

duration? ​
ts
optional duration?: number;

Defined in: src/interfaces/outbox-options.interface.ts:31

Claim lifetime in milliseconds. Defaults to stuckThreshold or 300000.

heartbeatFailureTolerance? ​
ts
optional heartbeatFailureTolerance?: number;

Defined in: src/interfaces/outbox-options.interface.ts:35

Consecutive heartbeat errors tolerated before abandoning the claim. Defaults to 1.

heartbeatInterval? ​
ts
optional heartbeatInterval?: number;

Defined in: src/interfaces/outbox-options.interface.ts:33

Active callback heartbeat interval in milliseconds. Defaults to duration / 3.


OutboxListOptions ​

Defined in: src/interfaces/outbox-admin.interface.ts:12

Extended by ​

Properties ​

after? ​
ts
optional after?: Date;

Defined in: src/interfaces/outbox-admin.interface.ts:18

before? ​
ts
optional before?: Date;

Defined in: src/interfaces/outbox-admin.interface.ts:17

eventType? ​
ts
optional eventType?: string;

Defined in: src/interfaces/outbox-admin.interface.ts:14

limit? ​
ts
optional limit?: number;

Defined in: src/interfaces/outbox-admin.interface.ts:16

status? ​
ts
optional status?: "PENDING" | "PROCESSING" | "SENT" | "FAILED";

Defined in: src/interfaces/outbox-admin.interface.ts:13

tenantId? ​
ts
optional tenantId?: string;

Defined in: src/interfaces/outbox-admin.interface.ts:15


OutboxListPage ​

Defined in: src/interfaces/outbox-admin.interface.ts:30

Properties ​

nextCursor ​
ts
nextCursor: string | null;

Defined in: src/interfaces/outbox-admin.interface.ts:32

records ​
ts
records: OutboxRecord[];

Defined in: src/interfaces/outbox-admin.interface.ts:31


OutboxNotification ​

Defined in: src/interfaces/outbox-wakeup.interface.ts:1

Properties ​

channel ​
ts
channel: string;

Defined in: src/interfaces/outbox-wakeup.interface.ts:2

payload? ​
ts
optional payload?: string;

Defined in: src/interfaces/outbox-wakeup.interface.ts:3


OutboxNotificationClient ​

Defined in: src/interfaces/outbox-wakeup.interface.ts:6

Methods ​

connect() ​
ts
connect(): Promise<void>;

Defined in: src/interfaces/outbox-wakeup.interface.ts:7

Returns ​

Promise<void>

end() ​
ts
end(): Promise<void>;

Defined in: src/interfaces/outbox-wakeup.interface.ts:9

Returns ​

Promise<void>

off()? ​
ts
optional off(event, handler): this;

Defined in: src/interfaces/outbox-wakeup.interface.ts:12

Optional EventEmitter-compatible listener cleanup API.

Parameters ​
ParameterType
eventstring
handler(payload) => void
Returns ​

this

on() ​
ts
on(event, handler): this;

Defined in: src/interfaces/outbox-wakeup.interface.ts:10

Parameters ​
ParameterType
eventstring
handler(payload) => void
Returns ​

this

query() ​
ts
query(sql): Promise<unknown>;

Defined in: src/interfaces/outbox-wakeup.interface.ts:8

Parameters ​
ParameterType
sqlstring
Returns ​

Promise<unknown>

removeListener()? ​
ts
optional removeListener(event, handler): this;

Defined in: src/interfaces/outbox-wakeup.interface.ts:14

Optional legacy EventEmitter-compatible listener cleanup API.

Parameters ​
ParameterType
eventstring
handler(payload) => void
Returns ​

this


OutboxOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:38

Properties ​

delivery? ​
ts
optional delivery?: OutboxDeliveryOptions;

Defined in: src/interfaces/outbox-options.interface.ts:49

events? ​
ts
optional events?: Type<any>[];

Defined in: src/interfaces/outbox-options.interface.ts:54

hooks? ​
ts
optional hooks?: OutboxHooks;

Defined in: src/interfaces/outbox-options.interface.ts:51

isGlobal? ​
ts
optional isGlobal?: boolean;

Defined in: src/interfaces/outbox-options.interface.ts:55

lease? ​
ts
optional lease?: OutboxLeaseOptions;

Defined in: src/interfaces/outbox-options.interface.ts:53

polling? ​
ts
optional polling?: OutboxPollingOptions;

Defined in: src/interfaces/outbox-options.interface.ts:45

prisma ​
ts
prisma: any;

Defined in: src/interfaces/outbox-options.interface.ts:44

forRoot: PrismaService class reference (resolved via DI, must be in a

Global ​

module). forRootAsync: resolved PrismaService instance from the factory. The instance must satisfy PrismaLike ($executeRaw, $queryRaw).

retry? ​
ts
optional retry?: OutboxRetryOptions;

Defined in: src/interfaces/outbox-options.interface.ts:46

stuckThreshold? ​
ts
optional stuckThreshold?: number;

Defined in: src/interfaces/outbox-options.interface.ts:57

Deprecated ​

Use lease.duration. Retained as a lease-duration compatibility alias.

tenancy? ​
ts
optional tenancy?: OutboxTenancyOptions;

Defined in: src/interfaces/outbox-options.interface.ts:50

transport? ​
ts
optional transport?: Type<
  | OutboxTransport
| OutboxPublisher>;

Defined in: src/interfaces/outbox-options.interface.ts:48

Custom transport class. Defaults to LocalTransport (in-process handler invocation).

wakeup? ​
ts
optional wakeup?: OutboxWakeupOptions;

Defined in: src/interfaces/outbox-options.interface.ts:52


OutboxOptionsFactory ​

Defined in: src/interfaces/outbox-options.interface.ts:89

Methods ​

createOutboxOptions() ​
ts
createOutboxOptions():
  | OutboxAsyncRuntimeOptions
| Promise<OutboxAsyncRuntimeOptions>;

Defined in: src/interfaces/outbox-options.interface.ts:90

Returns ​

| OutboxAsyncRuntimeOptions | Promise<OutboxAsyncRuntimeOptions>


OutboxPageOptions ​

Defined in: src/interfaces/outbox-admin.interface.ts:23

Extends ​

Properties ​

after? ​
ts
optional after?: Date;

Defined in: src/interfaces/outbox-admin.interface.ts:18

Inherited from ​

OutboxListOptions.after

before? ​
ts
optional before?: Date;

Defined in: src/interfaces/outbox-admin.interface.ts:17

Inherited from ​

OutboxListOptions.before

cursor? ​
ts
optional cursor?: string;

Defined in: src/interfaces/outbox-admin.interface.ts:25

Opaque exclusive continuation cursor returned by a previous page.

eventType? ​
ts
optional eventType?: string;

Defined in: src/interfaces/outbox-admin.interface.ts:14

Inherited from ​

OutboxListOptions.eventType

limit? ​
ts
optional limit?: number;

Defined in: src/interfaces/outbox-admin.interface.ts:16

Inherited from ​

OutboxListOptions.limit

status? ​
ts
optional status?: "PENDING" | "PROCESSING" | "SENT" | "FAILED";

Defined in: src/interfaces/outbox-admin.interface.ts:13

Inherited from ​

OutboxListOptions.status

tenantId? ​
ts
optional tenantId?: string;

Defined in: src/interfaces/outbox-admin.interface.ts:15

Inherited from ​

OutboxListOptions.tenantId


OutboxPollContext ​

Defined in: src/interfaces/outbox-hooks.interface.ts:17

Properties ​

batchSize ​
ts
readonly batchSize: number;

Defined in: src/interfaces/outbox-hooks.interface.ts:18

deliveryMode ​
ts
readonly deliveryMode: "local" | "publisher";

Defined in: src/interfaces/outbox-hooks.interface.ts:19


OutboxPollingOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:11

Properties ​

batchSize? ​
ts
optional batchSize?: number;

Defined in: src/interfaces/outbox-options.interface.ts:14

enabled? ​
ts
optional enabled?: boolean;

Defined in: src/interfaces/outbox-options.interface.ts:12

interval? ​
ts
optional interval?: number;

Defined in: src/interfaces/outbox-options.interface.ts:13


OutboxPublisher ​

Defined in: src/interfaces/outbox-publisher.interface.ts:3

Methods ​

publish() ​
ts
publish(record): Promise<void>;

Defined in: src/interfaces/outbox-publisher.interface.ts:4

Parameters ​
ParameterType
recordOutboxRecord
Returns ​

Promise<void>


OutboxRecord ​

Defined in: src/interfaces/outbox-record.interface.ts:1

Properties ​

aggregateId ​
ts
readonly aggregateId: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:15

aggregateType ​
ts
readonly aggregateType: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:14

causationId ​
ts
readonly causationId: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:19

correlationId ​
ts
readonly correlationId: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:18

createdAt ​
ts
readonly createdAt: Date;

Defined in: src/interfaces/outbox-record.interface.ts:6

eventType ​
ts
readonly eventType: string;

Defined in: src/interfaces/outbox-record.interface.ts:3

headers ​
ts
readonly headers: Readonly<Record<string, string>>;

Defined in: src/interfaces/outbox-record.interface.ts:20

id ​
ts
readonly id: string;

Defined in: src/interfaces/outbox-record.interface.ts:2

idempotencyKey ​
ts
readonly idempotencyKey: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:17

lastError ​
ts
readonly lastError: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:12

maxRetries ​
ts
readonly maxRetries: number;

Defined in: src/interfaces/outbox-record.interface.ts:11

nextAttemptAt ​
ts
readonly nextAttemptAt: Date | null;

Defined in: src/interfaces/outbox-record.interface.ts:9

occurredAt ​
ts
readonly occurredAt: Date;

Defined in: src/interfaces/outbox-record.interface.ts:21

partitionKey ​
ts
readonly partitionKey: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:16

payload ​
ts
readonly payload: Readonly<Record<string, unknown>>;

Defined in: src/interfaces/outbox-record.interface.ts:4

processedAt ​
ts
readonly processedAt: Date | null;

Defined in: src/interfaces/outbox-record.interface.ts:8

retryCount ​
ts
readonly retryCount: number;

Defined in: src/interfaces/outbox-record.interface.ts:10

status ​
ts
readonly status: "PENDING" | "PROCESSING" | "SENT" | "FAILED";

Defined in: src/interfaces/outbox-record.interface.ts:5

tenantId ​
ts
readonly tenantId: string | null;

Defined in: src/interfaces/outbox-record.interface.ts:13

updatedAt ​
ts
readonly updatedAt: Date;

Defined in: src/interfaces/outbox-record.interface.ts:7


OutboxRetryContext ​

Defined in: src/interfaces/outbox-hooks.interface.ts:38

Extends ​

Properties ​

aggregateId ​
ts
readonly aggregateId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:30

Inherited from ​

OutboxDispatchContext.aggregateId

aggregateType ​
ts
readonly aggregateType: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:29

Inherited from ​

OutboxDispatchContext.aggregateType

causationId ​
ts
readonly causationId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:34

Inherited from ​

OutboxDispatchContext.causationId

correlationId ​
ts
readonly correlationId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:33

Inherited from ​

OutboxDispatchContext.correlationId

error ​
ts
readonly error: Error;

Defined in: src/interfaces/outbox-hooks.interface.ts:39

eventId ​
ts
readonly eventId: string;

Defined in: src/interfaces/outbox-hooks.interface.ts:24

Inherited from ​

OutboxDispatchContext.eventId

eventType ​
ts
readonly eventType: string;

Defined in: src/interfaces/outbox-hooks.interface.ts:25

Inherited from ​

OutboxDispatchContext.eventType

headers ​
ts
readonly headers: Readonly<Record<string, string>>;

Defined in: src/interfaces/outbox-hooks.interface.ts:35

Inherited from ​

OutboxDispatchContext.headers

idempotencyKey ​
ts
readonly idempotencyKey: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:32

Inherited from ​

OutboxDispatchContext.idempotencyKey

maxRetries ​
ts
readonly maxRetries: number;

Defined in: src/interfaces/outbox-hooks.interface.ts:41

Overrides ​

OutboxDispatchContext.maxRetries

partitionKey ​
ts
readonly partitionKey: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:31

Inherited from ​

OutboxDispatchContext.partitionKey

record ​
ts
readonly record: OutboxRecord;

Defined in: src/interfaces/outbox-hooks.interface.ts:23

Inherited from ​

OutboxDispatchContext.record

retryCount ​
ts
readonly retryCount: number;

Defined in: src/interfaces/outbox-hooks.interface.ts:40

Overrides ​

OutboxDispatchContext.retryCount

tenantId ​
ts
readonly tenantId: string | null;

Defined in: src/interfaces/outbox-hooks.interface.ts:26

Inherited from ​

OutboxDispatchContext.tenantId


OutboxRetryOptions ​

Defined in: src/interfaces/outbox-options.interface.ts:17

Properties ​

backoff? ​
ts
optional backoff?: "fixed" | "exponential";

Defined in: src/interfaces/outbox-options.interface.ts:19

initialDelay? ​
ts
optional initialDelay?: number;

Defined in: src/interfaces/outbox-options.interface.ts:20

maxDelay? ​
ts
optional maxDelay?: number;

Defined in: src/interfaces/outbox-options.interface.ts:22

Maximum persisted retry delay in milliseconds. Defaults to 24 hours.

maxRetries? ​
ts
optional maxRetries?: number;

Defined in: src/interfaces/outbox-options.interface.ts:18


OutboxStats ​

Defined in: src/interfaces/outbox-admin.interface.ts:3

Properties ​

failed ​
ts
failed: number;

Defined in: src/interfaces/outbox-admin.interface.ts:7

oldestPendingAgeMs ​
ts
oldestPendingAgeMs: number | null;

Defined in: src/interfaces/outbox-admin.interface.ts:8

oldestProcessingAgeMs ​
ts
oldestProcessingAgeMs: number | null;

Defined in: src/interfaces/outbox-admin.interface.ts:9

pending ​
ts
pending: number;

Defined in: src/interfaces/outbox-admin.interface.ts:4

processing ​
ts
processing: number;

Defined in: src/interfaces/outbox-admin.interface.ts:5

sent ​
ts
sent: number;

Defined in: src/interfaces/outbox-admin.interface.ts:6


OutboxTenancyOptions ​

Defined in: src/interfaces/outbox-tenancy.interface.ts:14

Properties ​

policy? ​
ts
optional policy?: OutboxTenantPolicy;

Defined in: src/interfaces/outbox-tenancy.interface.ts:20

Controls producer tenant resolution. Defaults to optional for compatibility with non-tenant applications.

provider? ​
ts
optional provider?:
  | OutboxTenantProvider
| Type<OutboxTenantProvider>;

Defined in: src/interfaces/outbox-tenancy.interface.ts:15


OutboxTenantProvider ​

Defined in: src/interfaces/outbox-tenancy.interface.ts:5

Methods ​

getTenantId()? ​
ts
optional getTenantId():
  | string
  | Promise<string | null | undefined>
  | null
  | undefined;

Defined in: src/interfaces/outbox-tenancy.interface.ts:6

Returns ​

| string | Promise<string | null | undefined> | null | undefined

runWithTenant()? ​
ts
optional runWithTenant<T>(tenantId, fn): Promise<T>;

Defined in: src/interfaces/outbox-tenancy.interface.ts:11

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
tenantIdstring
fn() => Promise<T>
Returns ​

Promise<T>


OutboxTransport ​

Defined in: src/interfaces/outbox-transport.interface.ts:5

Methods ​

dispatch() ​
ts
dispatch(
   record,
   handlers,
context?): Promise<void>;

Defined in: src/interfaces/outbox-transport.interface.ts:6

Parameters ​
ParameterType
recordOutboxRecord
handlersOutboxHandler[]
context?OutboxHandlerContext
Returns ​

Promise<void>


OutboxWakeupOptions ​

Defined in: src/interfaces/outbox-wakeup.interface.ts:17

Properties ​

channel? ​
ts
optional channel?: string;

Defined in: src/interfaces/outbox-wakeup.interface.ts:19

clientFactory? ​
ts
optional clientFactory?: () =>
  | OutboxNotificationClient
  | Promise<OutboxNotificationClient | null>
  | null;

Defined in: src/interfaces/outbox-wakeup.interface.ts:23

Returns ​

| OutboxNotificationClient | Promise<OutboxNotificationClient | null> | null

connectionString? ​
ts
optional connectionString?: string;

Defined in: src/interfaces/outbox-wakeup.interface.ts:20

enabled? ​
ts
optional enabled?: boolean;

Defined in: src/interfaces/outbox-wakeup.interface.ts:18

reconnectDelay? ​
ts
optional reconnectDelay?: number;

Defined in: src/interfaces/outbox-wakeup.interface.ts:22

Base reconnect delay. Consecutive failures back off exponentially.

Type Aliases ​

OutboxAdminMutationResult ​

ts
type OutboxAdminMutationResult =
  | {
  outcome: "applied";
}
  | {
  outcome: "not_found";
}
  | {
  currentStatus: OutboxRecord["status"];
  outcome: "conflict";
}
  | {
  outcome: "lost_claim";
};

Defined in: src/interfaces/outbox-admin.interface.ts:46


OutboxEmitManyEntry ​

ts
type OutboxEmitManyEntry =
  | OutboxEvent
  | {
  event: OutboxEvent;
  options?: OutboxEmitOptions;
};

Defined in: src/interfaces/outbox-emit-options.interface.ts:28


OutboxEmitOptions ​

ts
type OutboxEmitOptions = OutboxEmitMetadata &
  | {
  tenantId?: string;
  tenantScope?: never;
}
  | {
  tenantId?: never;
  tenantScope: "global";
};

Defined in: src/interfaces/outbox-emit-options.interface.ts:14


OutboxEnvelopeErrorReason ​

ts
type OutboxEnvelopeErrorReason =
  | "invalid_type"
  | "empty"
  | "too_long"
  | "invalid_date"
  | "unsupported_json_value"
  | "circular"
  | "too_deep"
  | "too_large";

Defined in: src/errors/outbox-envelope.error.ts:3


OutboxTenantListOptions ​

ts
type OutboxTenantListOptions = Omit<OutboxListOptions, "tenantId">;

Defined in: src/interfaces/outbox-admin.interface.ts:21


OutboxTenantPageOptions ​

ts
type OutboxTenantPageOptions = Omit<OutboxPageOptions, "tenantId">;

Defined in: src/interfaces/outbox-admin.interface.ts:28


OutboxTenantPolicy ​

ts
type OutboxTenantPolicy = "optional" | "required" | "require-match";

Defined in: src/interfaces/outbox-tenancy.interface.ts:3


PrismaLike ​

ts
type PrismaLike = PrismaTransactionClient & {
  $executeRawUnsafe?: Promise<number>;
  $queryRawUnsafe?: Promise<T>;
};

Defined in: src/interfaces/prisma-transaction-client.interface.ts:16

Minimal type for PrismaService instance (used by OutboxPoller for polling queries).

Type Declaration ​

NameTypeDefined in
$executeRawUnsafe()?(query, ...values) => Promise<number>src/interfaces/prisma-transaction-client.interface.ts:17
$queryRawUnsafe()?(query, ...values) => Promise<T>src/interfaces/prisma-transaction-client.interface.ts:18

PrismaTransactionClient ​

ts
type PrismaTransactionClient = {
  $executeRaw: Promise<number>;
  $executeRawUnsafe?: Promise<number>;
  $queryRaw: Promise<T>;
  $queryRawUnsafe?: Promise<T>;
};

Defined in: src/interfaces/prisma-transaction-client.interface.ts:2

Minimal type for Prisma interactive transaction client (inside $transaction callback).

Methods ​

$executeRaw() ​
ts
$executeRaw(query, ...values): Promise<number>;

Defined in: src/interfaces/prisma-transaction-client.interface.ts:3

Parameters ​
ParameterType
queryTemplateStringsArray
...valuesunknown[]
Returns ​

Promise<number>

$executeRawUnsafe()? ​
ts
optional $executeRawUnsafe(query, ...values): Promise<number>;

Defined in: src/interfaces/prisma-transaction-client.interface.ts:7

Parameters ​
ParameterType
querystring
...valuesunknown[]
Returns ​

Promise<number>

$queryRaw() ​
ts
$queryRaw<T>(query, ...values): Promise<T>;

Defined in: src/interfaces/prisma-transaction-client.interface.ts:8

Type Parameters ​
Type ParameterDefault type
Tunknown
Parameters ​
ParameterType
queryTemplateStringsArray
...valuesunknown[]
Returns ​

Promise<T>

$queryRawUnsafe()? ​
ts
optional $queryRawUnsafe<T>(query, ...values): Promise<T>;

Defined in: src/interfaces/prisma-transaction-client.interface.ts:12

Type Parameters ​
Type ParameterDefault type
Tunknown
Parameters ​
ParameterType
querystring
...valuesunknown[]
Returns ​

Promise<T>

Variables ​

OUTBOX_EVENT_METADATA ​

ts
const OUTBOX_EVENT_METADATA: typeof OUTBOX_EVENT_METADATA;

Defined in: src/outbox.constants.ts:4


OUTBOX_INVALID_CONFIGURATION ​

ts
const OUTBOX_INVALID_CONFIGURATION: "OUTBOX_INVALID_CONFIGURATION" = 'OUTBOX_INVALID_CONFIGURATION';

Defined in: src/errors/outbox-configuration.error.ts:1


OUTBOX_INVALID_CURSOR ​

ts
const OUTBOX_INVALID_CURSOR: "OUTBOX_INVALID_CURSOR";

Defined in: src/errors/outbox-cursor.error.ts:1


OUTBOX_INVALID_ENVELOPE ​

ts
const OUTBOX_INVALID_ENVELOPE: "OUTBOX_INVALID_ENVELOPE";

Defined in: src/errors/outbox-envelope.error.ts:1


OUTBOX_OPTIONS ​

ts
const OUTBOX_OPTIONS: typeof OUTBOX_OPTIONS;

Defined in: src/outbox.constants.ts:1


OUTBOX_PERSISTED_INVARIANT_VIOLATION ​

ts
const OUTBOX_PERSISTED_INVARIANT_VIOLATION: "OUTBOX_PERSISTED_INVARIANT_VIOLATION" = 'OUTBOX_PERSISTED_INVARIANT_VIOLATION';

Defined in: src/errors/outbox-persisted-invariant.error.ts:1


OUTBOX_SCHEMA_MISMATCH ​

ts
const OUTBOX_SCHEMA_MISMATCH: "OUTBOX_SCHEMA_MISMATCH";

Defined in: src/errors/outbox-schema.error.ts:1


OUTBOX_TENANT_PROVIDER ​

ts
const OUTBOX_TENANT_PROVIDER: typeof OUTBOX_TENANT_PROVIDER;

Defined in: src/outbox.constants.ts:3


OUTBOX_TRANSPORT ​

ts
const OUTBOX_TRANSPORT: typeof OUTBOX_TRANSPORT;

Defined in: src/outbox.constants.ts:2


OUTBOX_WAKEUP_UNAVAILABLE ​

ts
const OUTBOX_WAKEUP_UNAVAILABLE: "OUTBOX_WAKEUP_UNAVAILABLE";

Defined in: src/errors/outbox-wakeup-unavailable.error.ts:1


REQUIRED_OUTBOX_SCHEMA_VERSION ​

ts
const REQUIRED_OUTBOX_SCHEMA_VERSION: "0.3.0" = '0.3.0';

Defined in: src/outbox.schema.ts:6

Functions ​

OnOutboxEvent() ​

ts
function OnOutboxEvent(...events): MethodDecorator;

Defined in: src/outbox.decorator.ts:9

Parameters ​

ParameterType
...eventsOutboxEventClass[]

Returns ​

MethodDecorator

References ​

OutboxOperatorService ​

Renames and re-exports OutboxAdminService

Released under the MIT License.