@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
new InboxAdminService(storage): InboxAdminService;Defined in: src/inbox-admin.service.ts:131
Parameters
| Parameter | Type |
|---|---|
storage | PrismaInboxStorage |
Returns
Methods
forGlobal()
forGlobal(): InboxAdminView;Defined in: src/inbox-admin.service.ts:138
Returns
forTenant()
forTenant(tenantId): InboxAdminView;Defined in: src/inbox-admin.service.ts:132
Parameters
| Parameter | Type |
|---|---|
tenantId | string |
Returns
InboxBackpressureError
Defined in: src/contracts/errors.ts:52
Extends
Constructors
Constructor
new InboxBackpressureError(): InboxBackpressureError;Defined in: src/contracts/errors.ts:53
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxConfigurationError
Defined in: src/contracts/errors.ts:68
Extends
Constructors
Constructor
new InboxConfigurationError(message): InboxConfigurationError;Defined in: src/contracts/errors.ts:69
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxConflictError
Defined in: src/contracts/errors.ts:15
Extends
Constructors
Constructor
new InboxConflictError(): InboxConflictError;Defined in: src/contracts/errors.ts:16
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxError
Defined in: src/contracts/errors.ts:1
Extends
Error
Extended by
InboxValidationErrorInboxConflictErrorInboxReplayConflictErrorInboxPermanentErrorInboxLeaseLostErrorInboxStateConflictErrorInboxBackpressureErrorInboxSchemaErrorInboxConfigurationErrorInboxTimeoutError
Constructors
Constructor
new InboxError(code, message): InboxError;Defined in: src/contracts/errors.ts:2
Parameters
| Parameter | Type |
|---|---|
code | string |
message | string |
Returns
Overrides
Error.constructorProperties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Error.causecode
readonly code: string;Defined in: src/contracts/errors.ts:3
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Error.messagename
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Error.namestack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Error.stackstackTraceLimit
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
Error.stackTraceLimitMethods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTraceInboxLeaseLostError
Defined in: src/contracts/errors.ts:39
Extends
Constructors
Constructor
new InboxLeaseLostError(): InboxLeaseLostError;Defined in: src/contracts/errors.ts:40
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxModule
Defined in: src/inbox.module.ts:26
Constructors
Constructor
new InboxModule(): InboxModule;Returns
Methods
forRoot()
static forRoot(options): DynamicModule;Defined in: src/inbox.module.ts:27
Parameters
| Parameter | Type |
|---|---|
options | InboxOptions |
Returns
DynamicModule
forRootAsync()
static forRootAsync(options): DynamicModule;Defined in: src/inbox.module.ts:34
Parameters
| Parameter | Type |
|---|---|
options | InboxModuleAsyncOptions |
Returns
DynamicModule
InboxPermanentError
Defined in: src/contracts/errors.ts:31
Extends
Constructors
Constructor
new InboxPermanentError(message?, code?): InboxPermanentError;Defined in: src/contracts/errors.ts:32
Parameters
| Parameter | Type | Default value |
|---|---|---|
message | string | "The message cannot be processed." |
code | string | "PERMANENT_ERROR" |
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
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
new InboxPrivilegedAdminService(storage): InboxPrivilegedAdminService;Defined in: src/inbox-admin.service.ts:144
Parameters
| Parameter | Type |
|---|---|
storage | PrismaInboxStorage |
Returns
Overrides
InboxAdminView.constructorMethods
get()
get(recordId): Promise<InboxRecord | null>;Defined in: src/inbox-admin.service.ts:54
Parameters
| Parameter | Type |
|---|---|
recordId | string |
Returns
Promise<InboxRecord | null>
Inherited from
list()
list(options?): Promise<InboxPage>;Defined in: src/inbox-admin.service.ts:57
Parameters
| Parameter | Type |
|---|---|
options | InboxListOptions |
Returns
Promise<InboxPage>
Inherited from
purgeCompletedPayload()
purgeCompletedPayload(options): Promise<number>;Defined in: src/inbox-admin.service.ts:120
Parameters
| Parameter | Type |
|---|---|
options | { before: Date; limit?: number; } |
options.before | Date |
options.limit? | number |
Returns
Promise<number>
Inherited from
InboxAdminView.purgeCompletedPayload
replay()
replay(options): Promise<InboxReplayResult>;Defined in: src/inbox-admin.service.ts:76
An intentional new delivery; the original COMPLETED receipt stays immutable.
Parameters
| Parameter | Type |
|---|---|
options | InboxReplayOptions |
Returns
Promise<InboxReplayResult>
Inherited from
requeue()
requeue(options): Promise<InboxRecord>;Defined in: src/inbox-admin.service.ts:65
Parameters
| Parameter | Type |
|---|---|
options | InboxRequeueOptions |
Returns
Promise<InboxRecord>
Inherited from
stats()
stats(): Promise<InboxStats>;Defined in: src/inbox-admin.service.ts:62
Returns
Promise<InboxStats>
Inherited from
InboxReplayConflictError
Defined in: src/contracts/errors.ts:23
Extends
Constructors
Constructor
new InboxReplayConflictError(): InboxReplayConflictError;Defined in: src/contracts/errors.ts:24
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxSchemaError
Defined in: src/contracts/errors.ts:60
Extends
Constructors
Constructor
new InboxSchemaError(): InboxSchemaError;Defined in: src/contracts/errors.ts:61
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxService
Defined in: src/inbox.service.ts:17
Implements
OnModuleInitOnModuleDestroy
Constructors
Constructor
new InboxService(options): InboxService;Defined in: src/inbox.service.ts:26
Parameters
| Parameter | Type |
|---|---|
options | InboxOptions |
Returns
Properties
admin
readonly admin: InboxAdminService;Defined in: src/inbox.service.ts:23
privilegedAdmin?
readonly optional privilegedAdmin?: InboxPrivilegedAdminService;Defined in: src/inbox.service.ts:24
Methods
accept()
accept(envelope): Promise<InboxReceipt>;Defined in: src/inbox.service.ts:59
Parameters
| Parameter | Type |
|---|---|
envelope | InboxEnvelope |
Returns
Promise<InboxReceipt>
close()
close(): Promise<void>;Defined in: src/inbox.service.ts:77
Returns
Promise<void>
initialize()
initialize(): Promise<void>;Defined in: src/inbox.service.ts:49
Returns
Promise<void>
onModuleDestroy()
onModuleDestroy(): Promise<void>;Defined in: src/inbox.service.ts:46
Returns
Promise<void>
Implementation of
OnModuleDestroy.onModuleDestroyonModuleInit()
onModuleInit(): Promise<void>;Defined in: src/inbox.service.ts:43
Returns
Promise<void>
Implementation of
OnModuleInit.onModuleInitrunOnce()
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
new InboxStateConflictError(): InboxStateConflictError;Defined in: src/contracts/errors.ts:45
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxTimeoutError
Defined in: src/contracts/errors.ts:73
Extends
Constructors
Constructor
new InboxTimeoutError(): InboxTimeoutError;Defined in: src/contracts/errors.ts:74
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
InboxValidationError
Defined in: src/contracts/errors.ts:10
Extends
Constructors
Constructor
new InboxValidationError(message): InboxValidationError;Defined in: src/contracts/errors.ts:11
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
Overrides
Properties
cause?
optional cause?: unknown;Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonly code: string;Defined in: src/contracts/errors.ts:3
Inherited from
message
message: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optional stack?: string;Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
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
Methods
captureStackTrace()
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.
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:
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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
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()
get(recordId): Promise<InboxRecord | null>;Defined in: src/inbox-admin.service.ts:54
Parameters
| Parameter | Type |
|---|---|
recordId | string |
Returns
Promise<InboxRecord | null>
list()
list(options?): Promise<InboxPage>;Defined in: src/inbox-admin.service.ts:57
Parameters
| Parameter | Type |
|---|---|
options | InboxListOptions |
Returns
Promise<InboxPage>
purgeCompletedPayload()
purgeCompletedPayload(options): Promise<number>;Defined in: src/inbox-admin.service.ts:120
Parameters
| Parameter | Type |
|---|---|
options | { before: Date; limit?: number; } |
options.before | Date |
options.limit? | number |
Returns
Promise<number>
replay()
replay(options): Promise<InboxReplayResult>;Defined in: src/inbox-admin.service.ts:76
An intentional new delivery; the original COMPLETED receipt stays immutable.
Parameters
| Parameter | Type |
|---|---|
options | InboxReplayOptions |
Returns
Promise<InboxReplayResult>
requeue()
requeue(options): Promise<InboxRecord>;Defined in: src/inbox-admin.service.ts:65
Parameters
| Parameter | Type |
|---|---|
options | InboxRequeueOptions |
Returns
Promise<InboxRecord>
stats()
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 Parameter | Default type |
|---|---|
TTx extends InboxTransaction | InboxTransaction |
Properties
attempt
attempt: number;Defined in: src/contracts/types.ts:96
causationId?
optional causationId?: string;Defined in: src/contracts/types.ts:100
consumer
consumer: string;Defined in: src/contracts/types.ts:94
correlationId?
optional correlationId?: string;Defined in: src/contracts/types.ts:99
inboxId
inboxId: string;Defined in: src/contracts/types.ts:95
messageId
messageId: string;Defined in: src/contracts/types.ts:92
replay?
optional replay?: {
actor: string;
originalInboxId: string;
reason: string;
requestedAt: Date;
requestId: string;
sourceVersion: string;
};Defined in: src/contracts/types.ts:98
actor
actor: string;originalInboxId
originalInboxId: string;reason
reason: string;requestedAt
requestedAt: Date;requestId
requestId: string;sourceVersion
sourceVersion: string;scope
scope: InboxScope;Defined in: src/contracts/types.ts:91
signal
signal: AbortSignal;Defined in: src/contracts/types.ts:97
source
source: string;Defined in: src/contracts/types.ts:93
tx
tx: TTx;Defined in: src/contracts/types.ts:90
InboxEnvelope
Defined in: src/contracts/types.ts:31
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends JsonValue | JsonValue |
Properties
causationId?
optional causationId?: string;Defined in: src/contracts/types.ts:40
consumer
consumer: string;Defined in: src/contracts/types.ts:34
correlationId?
optional correlationId?: string;Defined in: src/contracts/types.ts:39
eventType
eventType: string;Defined in: src/contracts/types.ts:36
headers?
optional headers?: {
traceparent?: string;
tracestate?: string;
};Defined in: src/contracts/types.ts:41
traceparent?
optional traceparent?: string;tracestate?
optional tracestate?: string;messageId
messageId: string;Defined in: src/contracts/types.ts:35
payload
payload: T;Defined in: src/contracts/types.ts:38
schemaVersion
schemaVersion: number;Defined in: src/contracts/types.ts:37
scope
scope: InboxScope;Defined in: src/contracts/types.ts:32
source
source: string;Defined in: src/contracts/types.ts:33
InboxHandler
Defined in: src/contracts/types.ts:102
Type Parameters
| Type Parameter | Default type |
|---|---|
TPayload | JsonValue |
TTx extends InboxTransaction | InboxTransaction |
Properties
consumer
consumer: string;Defined in: src/contracts/types.ts:106
eventType
eventType: string;Defined in: src/contracts/types.ts:107
schemaVersion
schemaVersion: number;Defined in: src/contracts/types.ts:108
validate?
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
| Parameter | Type |
|---|---|
payload | JsonValue |
Returns
boolean | void
Methods
handle()
handle(payload, context): Promise<void>;Defined in: src/contracts/types.ts:111
Parameters
| Parameter | Type |
|---|---|
payload | TPayload |
context | InboxContext<TTx> |
Returns
Promise<void>
InboxListOptions
Defined in: src/contracts/types.ts:118
Properties
consumer?
optional consumer?: string;Defined in: src/contracts/types.ts:120
cursor?
optional cursor?: string;Defined in: src/contracts/types.ts:121
limit?
optional limit?: number;Defined in: src/contracts/types.ts:122
status?
optional status?: InboxStatus;Defined in: src/contracts/types.ts:119
InboxModuleAsyncOptions
Defined in: src/inbox.module.ts:16
Extends
Pick<ModuleMetadata,"imports">
Properties
imports?
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
Pick.importsinject?
optional inject?: (InjectionToken | OptionalFactoryDependency)[];Defined in: src/inbox.module.ts:20
privilegedAdmin?
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
useFactory: (...dependencies) =>
| InboxOptions
| Promise<InboxOptions>;Defined in: src/inbox.module.ts:21
Parameters
| Parameter | Type |
|---|---|
...dependencies | any[] |
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?
optional code?: string;Defined in: src/contracts/types.ts:143
consumer?
optional consumer?: string;Defined in: src/contracts/types.ts:142
type
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?
optional consumers?: string[];Defined in: src/contracts/types.ts:164
Accepted consumer names; defaults to registered handler names. Required for ingress-only apps.
handlerContext?
optional handlerContext?: InboxHandlerContextRunner;Defined in: src/contracts/types.ts:170
handlers?
optional handlers?: InboxHandler<any, any>[];Defined in: src/contracts/types.ts:162
maxPayloadBytes?
optional maxPayloadBytes?: number;Defined in: src/contracts/types.ts:166
maxPendingMessages?
optional maxPendingMessages?: number;Defined in: src/contracts/types.ts:168
Optional approximate admission limit; concurrently accepted messages may exceed it.
observer?
optional observer?: (event) => void | Promise<void>;Defined in: src/contracts/types.ts:169
Parameters
| Parameter | Type |
|---|---|
event | InboxObservation |
Returns
void | Promise<void>
prisma
prisma: InboxPrismaClient;Defined in: src/contracts/types.ts:161
privilegedAdmin?
optional privilegedAdmin?: boolean;Defined in: src/contracts/types.ts:171
worker?
optional worker?: InboxWorkerOptions;Defined in: src/contracts/types.ts:165
InboxPage
Defined in: src/contracts/types.ts:124
Properties
nextCursor
nextCursor: string | null;Defined in: src/contracts/types.ts:126
records
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()
$executeRawUnsafe(query, ...values): Promise<number>;Defined in: src/contracts/types.ts:19
Parameters
| Parameter | Type |
|---|---|
query | string |
...values | any[] |
Returns
Promise<number>
Inherited from
InboxTransaction.$executeRawUnsafe
$queryRawUnsafe()
$queryRawUnsafe<T>(query, ...values): Promise<T>;Defined in: src/contracts/types.ts:18
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
query | string |
...values | any[] |
Returns
Promise<T>
Inherited from
InboxTransaction.$queryRawUnsafe
$transaction()
$transaction<T>(fn, options?): Promise<T>;Defined in: src/contracts/types.ts:22
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
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
id: string;Defined in: src/contracts/types.ts:86
kind
kind: "accepted" | "duplicate";Defined in: src/contracts/types.ts:85
status
status: InboxStatus;Defined in: src/contracts/types.ts:87
InboxRecord
Defined in: src/contracts/types.ts:43
Properties
attemptCount
attemptCount: number;Defined in: src/contracts/types.ts:58
causationId?
optional causationId?: string;Defined in: src/contracts/types.ts:72
claimToken
claimToken: string;Defined in: src/contracts/types.ts:56
completedAt
completedAt: Date | null;Defined in: src/contracts/types.ts:62
consumer
consumer: string;Defined in: src/contracts/types.ts:47
correlationId?
optional correlationId?: string;Defined in: src/contracts/types.ts:71
cycleAttemptCount
cycleAttemptCount: number;Defined in: src/contracts/types.ts:59
eventType
eventType: string;Defined in: src/contracts/types.ts:49
fingerprint
fingerprint: string;Defined in: src/contracts/types.ts:53
fingerprintVersion
fingerprintVersion: number;Defined in: src/contracts/types.ts:54
headers?
optional headers?: {
traceparent?: string;
tracestate?: string;
};Defined in: src/contracts/types.ts:73
traceparent?
optional traceparent?: string;tracestate?
optional tracestate?: string;id
id: string;Defined in: src/contracts/types.ts:44
lastErrorCode
lastErrorCode: string | null;Defined in: src/contracts/types.ts:66
lastErrorMessage
lastErrorMessage: string | null;Defined in: src/contracts/types.ts:67
lastRequeueActor
lastRequeueActor: string | null;Defined in: src/contracts/types.ts:69
lastRequeueAt
lastRequeueAt: Date | null;Defined in: src/contracts/types.ts:70
lastRequeueReason
lastRequeueReason: string | null;Defined in: src/contracts/types.ts:68
leaseExpiresAt
leaseExpiresAt: Date | null;Defined in: src/contracts/types.ts:64
messageId
messageId: string;Defined in: src/contracts/types.ts:48
nextAttemptAt
nextAttemptAt: Date;Defined in: src/contracts/types.ts:63
payload
payload: JsonValue;Defined in: src/contracts/types.ts:51
payloadPurged
payloadPurged: boolean;Defined in: src/contracts/types.ts:52
receivedAt
receivedAt: Date;Defined in: src/contracts/types.ts:61
replay?
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
actor: string;originalInboxId
originalInboxId: string;reason
reason: string;requestedAt
requestedAt: Date;requestId
requestId: string;sourceVersion
sourceVersion: string;requeueCount
requeueCount: number;Defined in: src/contracts/types.ts:60
rowVersion
rowVersion: string;Defined in: src/contracts/types.ts:57
schemaVersion
schemaVersion: number;Defined in: src/contracts/types.ts:50
scope
scope: InboxScope;Defined in: src/contracts/types.ts:45
source
source: string;Defined in: src/contracts/types.ts:46
status
status: InboxStatus;Defined in: src/contracts/types.ts:55
workerId
workerId: string | null;Defined in: src/contracts/types.ts:65
InboxReplayOptions
Defined in: src/inbox-admin.service.ts:16
Extends
Properties
actor
actor: string;Defined in: src/inbox-admin.service.ts:14
Inherited from
expectedVersion
expectedVersion: string;Defined in: src/inbox-admin.service.ts:12
Inherited from
InboxRequeueOptions.expectedVersion
id
id: string;Defined in: src/inbox-admin.service.ts:11
Inherited from
reason
reason: string;Defined in: src/inbox-admin.service.ts:13
Inherited from
requestId
requestId: string;Defined in: src/inbox-admin.service.ts:18
Stable UUID identifying one operator request within the original record's scope.
targetConsumer
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
kind: "accepted" | "duplicate";Defined in: src/inbox-admin.service.ts:23
record
record: InboxRecord;Defined in: src/inbox-admin.service.ts:24
InboxRequeueOptions
Defined in: src/inbox-admin.service.ts:10
Extended by
Properties
actor
actor: string;Defined in: src/inbox-admin.service.ts:14
expectedVersion
expectedVersion: string;Defined in: src/inbox-admin.service.ts:12
id
id: string;Defined in: src/inbox-admin.service.ts:11
reason
reason: string;Defined in: src/inbox-admin.service.ts:13
InboxStats
Defined in: src/contracts/types.ts:128
Properties
counts
counts: Record<InboxStatus, number>;Defined in: src/contracts/types.ts:129
oldestPendingAt
oldestPendingAt: Date | null;Defined in: src/contracts/types.ts:130
InboxTenancyOptions
Defined in: src/integrations/tenancy.ts:8
Properties
context
context: {
run: Promise<T>;
};Defined in: src/integrations/tenancy.ts:10
Public TenancyContext methods; structural so the integration stays optional.
run()
run<T>(tenantId, callback): Promise<T>;Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
tenantId | string |
callback | () => Promise<T> |
Returns
Promise<T>
global?
optional global?: "reject" | "shared";Defined in: src/integrations/tenancy.ts:20
Reject global messages by default. Shared work still obeys database RLS.
tenancy
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()
getCurrentTenantOrThrow(): string;Returns
string
getDbSettingKey()
getDbSettingKey(): string;Returns
string
withoutTenant()
withoutTenant<T>(callback): Promise<T>;Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
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()
$executeRawUnsafe(query, ...values): Promise<number>;Defined in: src/contracts/types.ts:19
Parameters
| Parameter | Type |
|---|---|
query | string |
...values | any[] |
Returns
Promise<number>
$queryRawUnsafe()
$queryRawUnsafe<T>(query, ...values): Promise<T>;Defined in: src/contracts/types.ts:18
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
query | string |
...values | any[] |
Returns
Promise<T>
InboxWorkerOptions
Defined in: src/contracts/types.ts:145
Properties
concurrency?
optional concurrency?: number;Defined in: src/contracts/types.ts:148
consumers?
optional consumers?: string[];Defined in: src/contracts/types.ts:147
enabled?
optional enabled?: boolean;Defined in: src/contracts/types.ts:146
heartbeatIntervalMs?
optional heartbeatIntervalMs?: number;Defined in: src/contracts/types.ts:151
leaseMs?
optional leaseMs?: number;Defined in: src/contracts/types.ts:150
lockTimeoutMs?
optional lockTimeoutMs?: number;Defined in: src/contracts/types.ts:154
maxAttempts?
optional maxAttempts?: number;Defined in: src/contracts/types.ts:156
pollIntervalMs?
optional pollIntervalMs?: number;Defined in: src/contracts/types.ts:149
retryBaseMs?
optional retryBaseMs?: number;Defined in: src/contracts/types.ts:157
retryMaxMs?
optional retryMaxMs?: number;Defined in: src/contracts/types.ts:158
shutdownTimeoutMs?
optional shutdownTimeoutMs?: number;Defined in: src/contracts/types.ts:155
transactionMaxWaitMs?
optional transactionMaxWaitMs?: number;Defined in: src/contracts/types.ts:153
transactionTimeoutMs?
optional transactionTimeoutMs?: number;Defined in: src/contracts/types.ts:152
Type Aliases
InboxHandlerContextRunner
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
| Parameter | Type |
|---|---|
context | InboxContext |
next | () => Promise<void> |
Returns
Promise<void>
InboxScope
type InboxScope =
| {
id: string;
kind: "tenant";
}
| {
kind: "global";
};Defined in: src/contracts/types.ts:8
InboxStatus
type InboxStatus = "PENDING" | "PROCESSING" | "RETRYABLE" | "COMPLETED" | "DEAD";Defined in: src/contracts/types.ts:9
JsonValue
type JsonValue =
| null
| boolean
| number
| string
| JsonValue[]
| {
[key: string]: JsonValue;
};Defined in: src/contracts/types.ts:1
Functions
createInboxTenancyContext()
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
| Parameter | Type |
|---|---|
options | InboxTenancyOptions |
Returns
(context, next) => Promise<void>