Skip to content

Types

If you found some weird/custom types in our documentation you can find what they mean on this page. If you are missing any let use know on Discord.

LoggingContext

Context about a log.

Interface

Note

This interface extends Record<string, any>

Keys Type Optional Description
critical Boolean Yes If this is a critical log entry.
configTab String Yes The config tab of the config screen this log entry is about.
action String Yes Action that the user toke.
reason String Yes Reason for action.
resource String Yes Resource this log is about.

LoggingFunc

A function or discord webhook url to send logging to.

Info

Will always be run from the server side.

Arguments

Name Type Description
source number The server id of the player who is trying to perform this action.
success boolean If the action was successful
context LoggingContext | undefined Context of the log entry.

Example - Config discord webhook

export const UserConfig: IUserConfig = {
  // ...
  adminLogging: "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXXXXXX/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
  // ...
}

Example - Config function

export const UserConfig: IUserConfig = {
  // ...
  adminLogging: function(source: number, success: boolean, context?: LoggingContext): void {
    // You can add your custom logging logic here, or do a simple:
    console.dir({source, success, context})
  },
  // ...
}

BankingAccountContact

An object representing a banking account.

Interface

Keys Type Optional Description
displayName String No The name of the bank account.
accountNumber Number | String | undefined Yes The account number or string of this bank account. If you keep this undefined money sent to it will go to the void.

ValidBankingAccountInput

Either a number, string or an object that represents a bank account.

Types

Type Description
Number A bank account number.
String A bank account string.
BankingAccountContact An object representing a banking account.

JobQueueModelMinimal

A minimal data object for a FiveMQ job.

Interface

Keys Type Optional Description
eventName String No The event name that will be called when this job is run.
triggerAt Number (unix timestamp) No When this job should be triggered.
args Any[] Yes An array with arguments that should be passed to the event.
receivingResourceName String | null Yes The resource name that will receive this job when triggered. If you don't know or leave empty it won't perform a resource state check before running the job.
status JobQueueStatus Yes The current status of the job. Should not be set unless you know what you're doing.
tpIdentifier String | null Yes An string identifier for this job, instead of just using a database id.

JobQueueStatus

The job status in the queue.

Types

Type Description
"pending" This job is waiting to be picked up by FiveMQ or it's not time yet to trigger this job.
"running" This job is being executed right now.
"done" This job has succesfully been executed.
"failed" This job has failed (or timed out) and will be requed and triggered after 5 minutes.
"deadletter" This job has failed too many times and needs manual intervention.