Skip to content

@nestarc/inbox ​

Published 0.2.0 API, SQL schema v2. Start with Installation, message processing, and recovery and operations. For application tests, see the testing guide and testing API. Signatures and source links come from the immutable release.

Classes ​

InboxAdminService ​

Defined in: src/inbox-admin.service.ts:130

Constructors ​

Constructor ​
ts
new InboxAdminService(storage): InboxAdminService;

Defined in: src/inbox-admin.service.ts:131

Parameters ​
ParameterType
storagePrismaInboxStorage
Returns ​

InboxAdminService

Methods ​

forGlobal() ​
ts
forGlobal(): InboxAdminView;

Defined in: src/inbox-admin.service.ts:138

Returns ​

InboxAdminView

forTenant() ​
ts
forTenant(tenantId): InboxAdminView;

Defined in: src/inbox-admin.service.ts:132

Parameters ​
ParameterType
tenantIdstring
Returns ​

InboxAdminView


InboxBackpressureError ​

Defined in: src/contracts/errors.ts:52

Extends ​

Constructors ​

Constructor ​
ts
new InboxBackpressureError(): InboxBackpressureError;

Defined in: src/contracts/errors.ts:53

Returns ​

InboxBackpressureError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxConfigurationError ​

Defined in: src/contracts/errors.ts:68

Extends ​

Constructors ​

Constructor ​
ts
new InboxConfigurationError(message): InboxConfigurationError;

Defined in: src/contracts/errors.ts:69

Parameters ​
ParameterType
messagestring
Returns ​

InboxConfigurationError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxConflictError ​

Defined in: src/contracts/errors.ts:15

Extends ​

Constructors ​

Constructor ​
ts
new InboxConflictError(): InboxConflictError;

Defined in: src/contracts/errors.ts:16

Returns ​

InboxConflictError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxError ​

Defined in: src/contracts/errors.ts:1

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​
ts
new InboxError(code, message): InboxError;

Defined in: src/contracts/errors.ts:2

Parameters ​
ParameterType
codestring
messagestring
Returns ​

InboxError

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: string;

Defined in: src/contracts/errors.ts:3

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

InboxLeaseLostError ​

Defined in: src/contracts/errors.ts:39

Extends ​

Constructors ​

Constructor ​
ts
new InboxLeaseLostError(): InboxLeaseLostError;

Defined in: src/contracts/errors.ts:40

Returns ​

InboxLeaseLostError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxModule ​

Defined in: src/inbox.module.ts:26

Constructors ​

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

InboxModule

Methods ​

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

Defined in: src/inbox.module.ts:27

Parameters ​
ParameterType
optionsInboxOptions
Returns ​

DynamicModule

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

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

Parameters ​
ParameterType
optionsInboxModuleAsyncOptions
Returns ​

DynamicModule


InboxPermanentError ​

Defined in: src/contracts/errors.ts:31

Extends ​

Constructors ​

Constructor ​
ts
new InboxPermanentError(message?, code?): InboxPermanentError;

Defined in: src/contracts/errors.ts:32

Parameters ​
ParameterTypeDefault value
messagestring"The message cannot be processed."
codestring"PERMANENT_ERROR"
Returns ​

InboxPermanentError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxPrivilegedAdminService ​

Defined in: src/inbox-admin.service.ts:143

Injected only when the module explicitly enables privilegedAdmin. Protect access in your app.

Extends ​

Constructors ​

Constructor ​
ts
new InboxPrivilegedAdminService(storage): InboxPrivilegedAdminService;

Defined in: src/inbox-admin.service.ts:144

Parameters ​
ParameterType
storagePrismaInboxStorage
Returns ​

InboxPrivilegedAdminService

Overrides ​
ts
InboxAdminView.constructor

Methods ​

get() ​
ts
get(recordId): Promise<InboxRecord | null>;

Defined in: src/inbox-admin.service.ts:54

Parameters ​
ParameterType
recordIdstring
Returns ​

Promise<InboxRecord | null>

Inherited from ​

InboxAdminView.get

list() ​
ts
list(options?): Promise<InboxPage>;

Defined in: src/inbox-admin.service.ts:57

Parameters ​
ParameterType
optionsInboxListOptions
Returns ​

Promise<InboxPage>

Inherited from ​

InboxAdminView.list

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

Defined in: src/inbox-admin.service.ts:120

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

Promise<number>

Inherited from ​

InboxAdminView.purgeCompletedPayload

replay() ​
ts
replay(options): Promise<InboxReplayResult>;

Defined in: src/inbox-admin.service.ts:76

An intentional new delivery; the original COMPLETED receipt stays immutable.

Parameters ​
ParameterType
optionsInboxReplayOptions
Returns ​

Promise<InboxReplayResult>

Inherited from ​

InboxAdminView.replay

requeue() ​
ts
requeue(options): Promise<InboxRecord>;

Defined in: src/inbox-admin.service.ts:65

Parameters ​
ParameterType
optionsInboxRequeueOptions
Returns ​

Promise<InboxRecord>

Inherited from ​

InboxAdminView.requeue

stats() ​
ts
stats(): Promise<InboxStats>;

Defined in: src/inbox-admin.service.ts:62

Returns ​

Promise<InboxStats>

Inherited from ​

InboxAdminView.stats


InboxReplayConflictError ​

Defined in: src/contracts/errors.ts:23

Extends ​

Constructors ​

Constructor ​
ts
new InboxReplayConflictError(): InboxReplayConflictError;

Defined in: src/contracts/errors.ts:24

Returns ​

InboxReplayConflictError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxSchemaError ​

Defined in: src/contracts/errors.ts:60

Extends ​

Constructors ​

Constructor ​
ts
new InboxSchemaError(): InboxSchemaError;

Defined in: src/contracts/errors.ts:61

Returns ​

InboxSchemaError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxService ​

Defined in: src/inbox.service.ts:17

Implements ​

  • OnModuleInit
  • OnModuleDestroy

Constructors ​

Constructor ​
ts
new InboxService(options): InboxService;

Defined in: src/inbox.service.ts:26

Parameters ​
ParameterType
optionsInboxOptions
Returns ​

InboxService

Properties ​

admin ​
ts
readonly admin: InboxAdminService;

Defined in: src/inbox.service.ts:23

privilegedAdmin? ​
ts
readonly optional privilegedAdmin?: InboxPrivilegedAdminService;

Defined in: src/inbox.service.ts:24

Methods ​

accept() ​
ts
accept(envelope): Promise<InboxReceipt>;

Defined in: src/inbox.service.ts:59

Parameters ​
ParameterType
envelopeInboxEnvelope
Returns ​

Promise<InboxReceipt>

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

Defined in: src/inbox.service.ts:77

Returns ​

Promise<void>

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

Defined in: src/inbox.service.ts:49

Returns ​

Promise<void>

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

Defined in: src/inbox.service.ts:46

Returns ​

Promise<void>

Implementation of ​
ts
OnModuleDestroy.onModuleDestroy

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

Defined in: src/inbox.service.ts:43

Returns ​

Promise<void>

Implementation of ​
ts
OnModuleInit.onModuleInit

runOnce() ​
ts
runOnce(): Promise<number>;

Defined in: src/inbox.service.ts:73

Explicit bounded processing for managed workers and tests; automatic polling is optional.

Returns ​

Promise<number>


InboxStateConflictError ​

Defined in: src/contracts/errors.ts:44

Extends ​

Constructors ​

Constructor ​
ts
new InboxStateConflictError(): InboxStateConflictError;

Defined in: src/contracts/errors.ts:45

Returns ​

InboxStateConflictError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxTimeoutError ​

Defined in: src/contracts/errors.ts:73

Extends ​

Constructors ​

Constructor ​
ts
new InboxTimeoutError(): InboxTimeoutError;

Defined in: src/contracts/errors.ts:74

Returns ​

InboxTimeoutError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace


InboxValidationError ​

Defined in: src/contracts/errors.ts:10

Extends ​

Constructors ​

Constructor ​
ts
new InboxValidationError(message): InboxValidationError;

Defined in: src/contracts/errors.ts:11

Parameters ​
ParameterType
messagestring
Returns ​

InboxValidationError

Overrides ​

InboxError.constructor

Properties ​

cause? ​
ts
optional cause?: unknown;

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

Inherited from ​

InboxError.cause

code ​
ts
readonly code: string;

Defined in: src/contracts/errors.ts:3

Inherited from ​

InboxError.code

message ​
ts
message: string;

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

Inherited from ​

InboxError.message

name ​
ts
name: string;

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

Inherited from ​

InboxError.name

stack? ​
ts
optional stack?: string;

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

Inherited from ​

InboxError.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 ​

InboxError.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 ​

InboxError.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 ​

InboxError.prepareStackTrace

Interfaces ​

InboxAdminView ​

Defined in: src/inbox-admin.service.ts:49

A fixed scope is captured when this view is constructed. It is never read from request payloads.

Extended by ​

Methods ​

get() ​
ts
get(recordId): Promise<InboxRecord | null>;

Defined in: src/inbox-admin.service.ts:54

Parameters ​
ParameterType
recordIdstring
Returns ​

Promise<InboxRecord | null>

list() ​
ts
list(options?): Promise<InboxPage>;

Defined in: src/inbox-admin.service.ts:57

Parameters ​
ParameterType
optionsInboxListOptions
Returns ​

Promise<InboxPage>

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

Defined in: src/inbox-admin.service.ts:120

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

Promise<number>

replay() ​
ts
replay(options): Promise<InboxReplayResult>;

Defined in: src/inbox-admin.service.ts:76

An intentional new delivery; the original COMPLETED receipt stays immutable.

Parameters ​
ParameterType
optionsInboxReplayOptions
Returns ​

Promise<InboxReplayResult>

requeue() ​
ts
requeue(options): Promise<InboxRecord>;

Defined in: src/inbox-admin.service.ts:65

Parameters ​
ParameterType
optionsInboxRequeueOptions
Returns ​

Promise<InboxRecord>

stats() ​
ts
stats(): Promise<InboxStats>;

Defined in: src/inbox-admin.service.ts:62

Returns ​

Promise<InboxStats>


InboxContext ​

Defined in: src/contracts/types.ts:89

Type Parameters ​

Type ParameterDefault type
TTx extends InboxTransactionInboxTransaction

Properties ​

attempt ​
ts
attempt: number;

Defined in: src/contracts/types.ts:96

causationId? ​
ts
optional causationId?: string;

Defined in: src/contracts/types.ts:100

consumer ​
ts
consumer: string;

Defined in: src/contracts/types.ts:94

correlationId? ​
ts
optional correlationId?: string;

Defined in: src/contracts/types.ts:99

inboxId ​
ts
inboxId: string;

Defined in: src/contracts/types.ts:95

messageId ​
ts
messageId: string;

Defined in: src/contracts/types.ts:92

replay? ​
ts
optional replay?: {
  actor: string;
  originalInboxId: string;
  reason: string;
  requestedAt: Date;
  requestId: string;
  sourceVersion: string;
};

Defined in: src/contracts/types.ts:98

actor ​
ts
actor: string;
originalInboxId ​
ts
originalInboxId: string;
reason ​
ts
reason: string;
requestedAt ​
ts
requestedAt: Date;
requestId ​
ts
requestId: string;
sourceVersion ​
ts
sourceVersion: string;

scope ​
ts
scope: InboxScope;

Defined in: src/contracts/types.ts:91

signal ​
ts
signal: AbortSignal;

Defined in: src/contracts/types.ts:97

source ​
ts
source: string;

Defined in: src/contracts/types.ts:93

tx ​
ts
tx: TTx;

Defined in: src/contracts/types.ts:90


InboxEnvelope ​

Defined in: src/contracts/types.ts:31

Type Parameters ​

Type ParameterDefault type
T extends JsonValueJsonValue

Properties ​

causationId? ​
ts
optional causationId?: string;

Defined in: src/contracts/types.ts:40

consumer ​
ts
consumer: string;

Defined in: src/contracts/types.ts:34

correlationId? ​
ts
optional correlationId?: string;

Defined in: src/contracts/types.ts:39

eventType ​
ts
eventType: string;

Defined in: src/contracts/types.ts:36

headers? ​
ts
optional headers?: {
  traceparent?: string;
  tracestate?: string;
};

Defined in: src/contracts/types.ts:41

traceparent? ​
ts
optional traceparent?: string;
tracestate? ​
ts
optional tracestate?: string;

messageId ​
ts
messageId: string;

Defined in: src/contracts/types.ts:35

payload ​
ts
payload: T;

Defined in: src/contracts/types.ts:38

schemaVersion ​
ts
schemaVersion: number;

Defined in: src/contracts/types.ts:37

scope ​
ts
scope: InboxScope;

Defined in: src/contracts/types.ts:32

source ​
ts
source: string;

Defined in: src/contracts/types.ts:33


InboxHandler ​

Defined in: src/contracts/types.ts:102

Type Parameters ​

Type ParameterDefault type
TPayloadJsonValue
TTx extends InboxTransactionInboxTransaction

Properties ​

consumer ​
ts
consumer: string;

Defined in: src/contracts/types.ts:106

eventType ​
ts
eventType: string;

Defined in: src/contracts/types.ts:107

schemaVersion ​
ts
schemaVersion: number;

Defined in: src/contracts/types.ts:108

validate? ​
ts
optional validate?: (payload) => boolean | void;

Defined in: src/contracts/types.ts:110

Return false or throw to quarantine invalid payloads. Must be synchronous and side-effect free.

Parameters ​
ParameterType
payloadJsonValue
Returns ​

boolean | void

Methods ​

handle() ​
ts
handle(payload, context): Promise<void>;

Defined in: src/contracts/types.ts:111

Parameters ​
ParameterType
payloadTPayload
contextInboxContext<TTx>
Returns ​

Promise<void>


InboxListOptions ​

Defined in: src/contracts/types.ts:118

Properties ​

consumer? ​
ts
optional consumer?: string;

Defined in: src/contracts/types.ts:120

cursor? ​
ts
optional cursor?: string;

Defined in: src/contracts/types.ts:121

limit? ​
ts
optional limit?: number;

Defined in: src/contracts/types.ts:122

status? ​
ts
optional status?: InboxStatus;

Defined in: src/contracts/types.ts:119


InboxModuleAsyncOptions ​

Defined in: src/inbox.module.ts:16

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?: (InjectionToken | OptionalFactoryDependency)[];

Defined in: src/inbox.module.ts:20

privilegedAdmin? ​
ts
optional privilegedAdmin?: boolean;

Defined in: src/inbox.module.ts:23

Explicit module-level opt-in is required to register the cross-tenant admin provider.

useFactory ​
ts
useFactory: (...dependencies) =>
  | InboxOptions
| Promise<InboxOptions>;

Defined in: src/inbox.module.ts:21

Parameters ​
ParameterType
...dependenciesany[]
Returns ​

| InboxOptions | Promise<InboxOptions>


InboxObservation ​

Defined in: src/contracts/types.ts:133

No payloads, tenant IDs, or raw exceptions are passed to observation hooks.

Properties ​

code? ​
ts
optional code?: string;

Defined in: src/contracts/types.ts:143

consumer? ​
ts
optional consumer?: string;

Defined in: src/contracts/types.ts:142

type ​
ts
type:
  | "accepted"
  | "duplicate"
  | "completed"
  | "retry"
  | "dead"
  | "lease_lost"
  | "error";

Defined in: src/contracts/types.ts:134


InboxOptions ​

Defined in: src/contracts/types.ts:160

Properties ​

consumers? ​
ts
optional consumers?: string[];

Defined in: src/contracts/types.ts:164

Accepted consumer names; defaults to registered handler names. Required for ingress-only apps.

handlerContext? ​
ts
optional handlerContext?: InboxHandlerContextRunner;

Defined in: src/contracts/types.ts:170

handlers? ​
ts
optional handlers?: InboxHandler<any, any>[];

Defined in: src/contracts/types.ts:162

maxPayloadBytes? ​
ts
optional maxPayloadBytes?: number;

Defined in: src/contracts/types.ts:166

maxPendingMessages? ​
ts
optional maxPendingMessages?: number;

Defined in: src/contracts/types.ts:168

Optional approximate admission limit; concurrently accepted messages may exceed it.

observer? ​
ts
optional observer?: (event) => void | Promise<void>;

Defined in: src/contracts/types.ts:169

Parameters ​
ParameterType
eventInboxObservation
Returns ​

void | Promise<void>

prisma ​
ts
prisma: InboxPrismaClient;

Defined in: src/contracts/types.ts:161

privilegedAdmin? ​
ts
optional privilegedAdmin?: boolean;

Defined in: src/contracts/types.ts:171

worker? ​
ts
optional worker?: InboxWorkerOptions;

Defined in: src/contracts/types.ts:165


InboxPage ​

Defined in: src/contracts/types.ts:124

Properties ​

nextCursor ​
ts
nextCursor: string | null;

Defined in: src/contracts/types.ts:126

records ​
ts
records: InboxRecord[];

Defined in: src/contracts/types.ts:125


InboxPrismaClient ​

Defined in: src/contracts/types.ts:21

The subset of a Prisma interactive transaction used by the inbox.

Extends ​

Methods ​

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

Defined in: src/contracts/types.ts:19

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

Promise<number>

Inherited from ​

InboxTransaction.$executeRawUnsafe

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

Defined in: src/contracts/types.ts:18

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

Promise<T>

Inherited from ​

InboxTransaction.$queryRawUnsafe

$transaction() ​
ts
$transaction<T>(fn, options?): Promise<T>;

Defined in: src/contracts/types.ts:22

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
fn(tx) => Promise<T>
options?{ isolationLevel?: "ReadCommitted"; maxWait?: number; timeout?: number; }
options.isolationLevel?"ReadCommitted"
options.maxWait?number
options.timeout?number
Returns ​

Promise<T>


InboxReceipt ​

Defined in: src/contracts/types.ts:84

Properties ​

id ​
ts
id: string;

Defined in: src/contracts/types.ts:86

kind ​
ts
kind: "accepted" | "duplicate";

Defined in: src/contracts/types.ts:85

status ​
ts
status: InboxStatus;

Defined in: src/contracts/types.ts:87


InboxRecord ​

Defined in: src/contracts/types.ts:43

Properties ​

attemptCount ​
ts
attemptCount: number;

Defined in: src/contracts/types.ts:58

causationId? ​
ts
optional causationId?: string;

Defined in: src/contracts/types.ts:72

claimToken ​
ts
claimToken: string;

Defined in: src/contracts/types.ts:56

completedAt ​
ts
completedAt: Date | null;

Defined in: src/contracts/types.ts:62

consumer ​
ts
consumer: string;

Defined in: src/contracts/types.ts:47

correlationId? ​
ts
optional correlationId?: string;

Defined in: src/contracts/types.ts:71

cycleAttemptCount ​
ts
cycleAttemptCount: number;

Defined in: src/contracts/types.ts:59

eventType ​
ts
eventType: string;

Defined in: src/contracts/types.ts:49

fingerprint ​
ts
fingerprint: string;

Defined in: src/contracts/types.ts:53

fingerprintVersion ​
ts
fingerprintVersion: number;

Defined in: src/contracts/types.ts:54

headers? ​
ts
optional headers?: {
  traceparent?: string;
  tracestate?: string;
};

Defined in: src/contracts/types.ts:73

traceparent? ​
ts
optional traceparent?: string;
tracestate? ​
ts
optional tracestate?: string;

id ​
ts
id: string;

Defined in: src/contracts/types.ts:44

lastErrorCode ​
ts
lastErrorCode: string | null;

Defined in: src/contracts/types.ts:66

lastErrorMessage ​
ts
lastErrorMessage: string | null;

Defined in: src/contracts/types.ts:67

lastRequeueActor ​
ts
lastRequeueActor: string | null;

Defined in: src/contracts/types.ts:69

lastRequeueAt ​
ts
lastRequeueAt: Date | null;

Defined in: src/contracts/types.ts:70

lastRequeueReason ​
ts
lastRequeueReason: string | null;

Defined in: src/contracts/types.ts:68

leaseExpiresAt ​
ts
leaseExpiresAt: Date | null;

Defined in: src/contracts/types.ts:64

messageId ​
ts
messageId: string;

Defined in: src/contracts/types.ts:48

nextAttemptAt ​
ts
nextAttemptAt: Date;

Defined in: src/contracts/types.ts:63

payload ​
ts
payload: JsonValue;

Defined in: src/contracts/types.ts:51

payloadPurged ​
ts
payloadPurged: boolean;

Defined in: src/contracts/types.ts:52

receivedAt ​
ts
receivedAt: Date;

Defined in: src/contracts/types.ts:61

replay? ​
ts
optional replay?: {
  actor: string;
  originalInboxId: string;
  reason: string;
  requestedAt: Date;
  requestId: string;
  sourceVersion: string;
};

Defined in: src/contracts/types.ts:75

Present only for an explicitly requested replay; the original receipt is retained.

actor ​
ts
actor: string;
originalInboxId ​
ts
originalInboxId: string;
reason ​
ts
reason: string;
requestedAt ​
ts
requestedAt: Date;
requestId ​
ts
requestId: string;
sourceVersion ​
ts
sourceVersion: string;

requeueCount ​
ts
requeueCount: number;

Defined in: src/contracts/types.ts:60

rowVersion ​
ts
rowVersion: string;

Defined in: src/contracts/types.ts:57

schemaVersion ​
ts
schemaVersion: number;

Defined in: src/contracts/types.ts:50

scope ​
ts
scope: InboxScope;

Defined in: src/contracts/types.ts:45

source ​
ts
source: string;

Defined in: src/contracts/types.ts:46

status ​
ts
status: InboxStatus;

Defined in: src/contracts/types.ts:55

workerId ​
ts
workerId: string | null;

Defined in: src/contracts/types.ts:65


InboxReplayOptions ​

Defined in: src/inbox-admin.service.ts:16

Extends ​

Properties ​

actor ​
ts
actor: string;

Defined in: src/inbox-admin.service.ts:14

Inherited from ​

InboxRequeueOptions.actor

expectedVersion ​
ts
expectedVersion: string;

Defined in: src/inbox-admin.service.ts:12

Inherited from ​

InboxRequeueOptions.expectedVersion

id ​
ts
id: string;

Defined in: src/inbox-admin.service.ts:11

Inherited from ​

InboxRequeueOptions.id

reason ​
ts
reason: string;

Defined in: src/inbox-admin.service.ts:13

Inherited from ​

InboxRequeueOptions.reason

requestId ​
ts
requestId: string;

Defined in: src/inbox-admin.service.ts:18

Stable UUID identifying one operator request within the original record's scope.

targetConsumer ​
ts
targetConsumer: string;

Defined in: src/inbox-admin.service.ts:20

May name the original consumer or a separately registered projection consumer.


InboxReplayResult ​

Defined in: src/inbox-admin.service.ts:22

Properties ​

kind ​
ts
kind: "accepted" | "duplicate";

Defined in: src/inbox-admin.service.ts:23

record ​
ts
record: InboxRecord;

Defined in: src/inbox-admin.service.ts:24


InboxRequeueOptions ​

Defined in: src/inbox-admin.service.ts:10

Extended by ​

Properties ​

actor ​
ts
actor: string;

Defined in: src/inbox-admin.service.ts:14

expectedVersion ​
ts
expectedVersion: string;

Defined in: src/inbox-admin.service.ts:12

id ​
ts
id: string;

Defined in: src/inbox-admin.service.ts:11

reason ​
ts
reason: string;

Defined in: src/inbox-admin.service.ts:13


InboxStats ​

Defined in: src/contracts/types.ts:128

Properties ​

counts ​
ts
counts: Record<InboxStatus, number>;

Defined in: src/contracts/types.ts:129

oldestPendingAt ​
ts
oldestPendingAt: Date | null;

Defined in: src/contracts/types.ts:130


InboxTenancyOptions ​

Defined in: src/integrations/tenancy.ts:8

Properties ​

context ​
ts
context: {
  run: Promise<T>;
};

Defined in: src/integrations/tenancy.ts:10

Public TenancyContext methods; structural so the integration stays optional.

run() ​
ts
run<T>(tenantId, callback): Promise<T>;
Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
tenantIdstring
callback() => Promise<T>
Returns ​

Promise<T>

global? ​
ts
optional global?: "reject" | "shared";

Defined in: src/integrations/tenancy.ts:20

Reject global messages by default. Shared work still obeys database RLS.

tenancy ​
ts
tenancy: {
  getCurrentTenantOrThrow: string;
  getDbSettingKey: string;
  withoutTenant: Promise<T>;
};

Defined in: src/integrations/tenancy.ts:14

Public TenancyService methods, supplied by the application's TenancyModule.

getCurrentTenantOrThrow() ​
ts
getCurrentTenantOrThrow(): string;
Returns ​

string

getDbSettingKey() ​
ts
getDbSettingKey(): string;
Returns ​

string

withoutTenant() ​
ts
withoutTenant<T>(callback): Promise<T>;
Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
callback() => Promise<T>
Returns ​

Promise<T>


InboxTransaction ​

Defined in: src/contracts/types.ts:17

The subset of a Prisma interactive transaction used by the inbox.

Extended by ​

Methods ​

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

Defined in: src/contracts/types.ts:19

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

Promise<number>

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

Defined in: src/contracts/types.ts:18

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

Promise<T>


InboxWorkerOptions ​

Defined in: src/contracts/types.ts:145

Properties ​

concurrency? ​
ts
optional concurrency?: number;

Defined in: src/contracts/types.ts:148

consumers? ​
ts
optional consumers?: string[];

Defined in: src/contracts/types.ts:147

enabled? ​
ts
optional enabled?: boolean;

Defined in: src/contracts/types.ts:146

heartbeatIntervalMs? ​
ts
optional heartbeatIntervalMs?: number;

Defined in: src/contracts/types.ts:151

leaseMs? ​
ts
optional leaseMs?: number;

Defined in: src/contracts/types.ts:150

lockTimeoutMs? ​
ts
optional lockTimeoutMs?: number;

Defined in: src/contracts/types.ts:154

maxAttempts? ​
ts
optional maxAttempts?: number;

Defined in: src/contracts/types.ts:156

pollIntervalMs? ​
ts
optional pollIntervalMs?: number;

Defined in: src/contracts/types.ts:149

retryBaseMs? ​
ts
optional retryBaseMs?: number;

Defined in: src/contracts/types.ts:157

retryMaxMs? ​
ts
optional retryMaxMs?: number;

Defined in: src/contracts/types.ts:158

shutdownTimeoutMs? ​
ts
optional shutdownTimeoutMs?: number;

Defined in: src/contracts/types.ts:155

transactionMaxWaitMs? ​
ts
optional transactionMaxWaitMs?: number;

Defined in: src/contracts/types.ts:153

transactionTimeoutMs? ​
ts
optional transactionTimeoutMs?: number;

Defined in: src/contracts/types.ts:152

Type Aliases ​

InboxHandlerContextRunner ​

ts
type InboxHandlerContextRunner = (context, next) => Promise<void>;

Defined in: src/contracts/types.ts:114

Wrap handler execution inside its existing transaction, e.g. with tenant context.

Parameters ​

ParameterType
contextInboxContext
next() => Promise<void>

Returns ​

Promise<void>


InboxScope ​

ts
type InboxScope =
  | {
  id: string;
  kind: "tenant";
}
  | {
  kind: "global";
};

Defined in: src/contracts/types.ts:8


InboxStatus ​

ts
type InboxStatus = "PENDING" | "PROCESSING" | "RETRYABLE" | "COMPLETED" | "DEAD";

Defined in: src/contracts/types.ts:9


JsonValue ​

ts
type JsonValue =
  | null
  | boolean
  | number
  | string
  | JsonValue[]
  | {
[key: string]: JsonValue;
};

Defined in: src/contracts/types.ts:1

Functions ​

createInboxTenancyContext() ​

ts
function createInboxTenancyContext(options): (context, next) => Promise<void>;

Defined in: src/integrations/tenancy.ts:32

Bind @nestarc/tenancy context to the durable message scope and set the canonical PostgreSQL setting on Inbox's existing transaction before running the handler. Use the application's raw Prisma client for Inbox, not a tenancy extension.

The application authenticates the scope before accept(), provisions RLS policies using the same setting key, and runs handlers with a non-owner, non-BYPASSRLS database role. This adapter neither installs policies nor grants authorization.

Parameters ​

ParameterType
optionsInboxTenancyOptions

Returns ​

(context, next) => Promise<void>

Released under the MIT License.