Types
Updated on Sep 12, 2025
99 minutes to read
AiMessage
interface AiMessage {
/**
* Sender role in the conversation
*/
role: 'user' | 'system' | 'assistant';
/**
* Text content of the message
*/
content: string;
}
AiPrompt
interface AiPrompt {
/**
* Conversation history passed to the model
*/
messages: Array<AiMessage>;
}
AiResponse
interface AiResponse {
/**
* Indicates whether the request was successful
*/
success: boolean;
/**
* HTTP status code returned by the API
*/
statusCode: number;
/**
* Response data containing message choices
*/
data?: {
choices: Array<{
/**
* Index of the choice in the response array
*/
index: number;
/**
* The AI-generated message
*/
message: AiMessage;
}>;
};
/**
* Error information, present if the request failed
*/
error?: {
/**
* Error code returned by the API
*/
code: string;
/**
* Error message returned by the API
*/
message: string;
};
}
AiResponseOptions
type AiResponseOptions = {
/**
* Optional inline keyboard layout.
* Each element in the outer array represents a row of buttons.
* Each element in the inner array represents a button in that row.
*/
inlineKeyboard?: Array<Array<{
/**
* Text label shown on the button
*/
label: string;
/**
* Tuple containing the method name and an object with parameters
*/
method: [string, Record<string, unknown>];
}>>;
}
Application
interface Application {
/**
* Unique identifier of the application
*/
id: string;
/**
* Human-readable name of the application
*/
name: string;
/**
* Optional description of the application
*/
description: string | null;
/**
* Optional semantic version (e.g. "1.0.3")
*/
version: string | null;
/**
* Vendor or company name that provides the application
*/
vendor: string | null;
/**
* Vendor unique identifier (if available)
*/
vendorId: string | null;
/**
* Relative base URL of the application (may be context-dependent)
*/
baseUrl: string;
/**
* Absolute base URL of the application
*/
absoluteBaseUrl: string;
/**
* Optional URL pointing to the application’s logo (relative)
*/
logoUrl: string | null;
/**
* Optional absolute URL pointing to the application’s logo
*/
absoluteLogoUrl: string | null;
}
BarcodeConfig
interface BarcodeConfig {
/**
* Barcode type.
*/
type: BarcodeTypes;
/**
* The data to encode.
*/
value: string;
/**
* Width of the barcode.
*/
width: number;
/**
* Height of the barcode.
*/
height: number;
/**
* Hex color of the barcode.
*/
color?: string;
}
BaseFileParams
interface BaseFileParams {
/**
* If true, returns the file as an inline resource (displayed in the browser)
* instead of forcing a download.
*/
inline?: boolean,
/**
* Full file name (with extension) to use for the generated file.
* If both 'filename' and 'basename' are provided, 'basename' takes priority.
*/
basename?: string,
/**
* File name without extension. The file extension will PNG
*/
filename?: string,
}
BaseQuery
/**
* Core query operations shared by SELECT‑style queries and command statements.
*/
interface BaseQuery {
/**
* Return all rows.
*/
all(): object[];
/**
* Return the first row or null.
*/
one(): object | null;
/**
* True if at least one row matches.
*/
exists(): boolean;
/**
* Sum of a column.
*
* @param column The column name to sum.
*/
sum(column: string): number | null;
/**
* Minimum value of a column.
*
* @param column The column name to get the minimum value of.
*/
min(column: string): any;
/**
* Maximum value of a column.
*
* @param column The column name to get the maximum value of.
*/
max(column: string): any;
/**
* Average of a column.
*
* @param column The column name to calculate the average of.
*/
avg(column: string): number | null;
/**
* Count of rows.
*/
count(): number;
/**
* Single scalar value (first column of first row).
*/
scalar(): any;
/**
* Array of first‑column values.
*/
column(): any[];
/**
* Cancel the running query.
*
* @param callback A function called for each row.
*/
each(callback: (row: Record<string, any>) => void): void;
}
BaseValidatorOptions
interface BaseValidatorOptions {
/**
* The user-defined error message.
*/
message?: string;
}
CallbackValidatorOptions
interface CallbackValidatorOptions extends BaseValidatorOptions {
/**
* A callback to perform custom validation.
*/
callback?: ValidatorCallback;
/**
* Whether to invert the validation logic.
*/
not?: boolean;
}
Column
/**
* Plain column name or an aliased column definition.
*/
type Column = string | ColumnWithAlias;
ColumnWithAlias
/**
* Alias → column name or nested Expression.
*/
type ColumnWithAlias = {
[key: string]: string | Expression
};
Command
/**
* Builder for command‑style statements.
*/
interface Command extends BaseQuery {
}
CompileOptions
interface CompileOptions {
/** Keep HTML comments in the compiled output */
keepComments?: boolean;
/** Preserve whitespace in the compiled output */
keepWhitespace?: boolean;
/** Custom elements definitions */
customElements?: Array<{
/** Name of the custom element */
name: string;
/** Template string for the custom element */
template: string;
}>;
}
Conditions
/**
* Various forms of WHERE/HAVING clauses (array, Expression, hash, etc.).
*/
type Conditions = any[] | Expression | Expression[] | HashCondition | HashCondition[];
type ConvertFormat = 'png' | 'pdf';
Cookie
/**
* Represents an HTTP cookie.
*/
interface Cookie {
/** The cookie name. */
name: string;
/** The cookie value (optional). */
value?: string;
/** The domain scope of the cookie (optional). */
domain?: string;
/** Expiration time as a Unix timestamp (optional). */
expire?: number;
/** The path scope of the cookie (optional). */
path?: string;
/** Whether the cookie should only be transmitted over secure protocols (optional). */
secure?: boolean;
/** Whether the cookie is HTTP-only and inaccessible to JavaScript (optional). */
httpOnly?: boolean;
/** SameSite policy, e.g., "Strict", "Lax", or "None" (optional). */
sameSite?: string;
}
DateUnit
type DateUnit =
| 'year'
| 'years'
| 'quarter'
| 'quarters'
| 'month'
| 'months'
| 'week'
| 'weeks'
| 'day'
| 'days';
E8Date
/**
* Date in the format 'YYYY-MM-DD'
*/
type E8Date = string;
E8ObjectId
/**
* Numeric identifier of a list object
*/
type E8ObjectId = number;
E8ScriptAlias
/**
* Script alias of a metadata object (e.g., form, list, report)
*/
type E8ScriptAlias = string;
E8Time
/**
* Time in the format 'HH:mm:ss'
*/
type E8Time = string;
E8Timestamp
/**
* Standard Unix timestamp (milliseconds since the epoch)
*/
type E8Timestamp = number;
EmailAccount
interface EmailAccount {
/**
* Unique account ID
*/
id: string;
/**
* Display name of the account
*/
name: string;
/**
* Whether this account is private
*/
private: boolean;
/**
* Whether this account is the default one
*/
default: boolean;
/**
* Sender details
*/
from: {
/**
* Display name of the sender
*/
name: string;
/**
* Sender email address
*/
email: string;
},
/**
* Default signature associated with this account
*/
signature: EmailSignature | null;
}
EmailApiClient
interface EmailApiClient {
/**
* Sets the active folder for subsequent queries.
*
* @param folderId The ID of the folder to select.
*/
setFolder(folderId: string): EmailApiClient;
/**
* Adds filtering conditions to the query.
*
* @param conditions The conditions to filter messages.
*/
where(conditions: Conditions): EmailApiClient;
/**
* Adds AND filtering conditions to the query.
*
* @param conditions The conditions to add with AND logic.
*/
andWhere(conditions: Conditions): EmailApiClient;
/**
* Adds OR filtering conditions to the query.
*
* @param conditions The conditions to add with OR logic.
*/
orWhere(conditions: Conditions): EmailApiClient;
/**
* Retrieves the list of available folders.
*/
getFolders(): EmailApiClientResponseFolders;
/**
* Retrieves a paginated list of messages from the selected folder.
*
* @param pageToken Token for the page to fetch; null for the first page.
*/
getMessages(pageToken: string | null): EmailApiClientResponseMessages;
/**
* Retrieves details of a single message by its ID.
*
* @param messageId The ID of the message.
*/
getMessage(messageId: string): EmailApiClientResponseMessage;
/**
* Retrieves attachments of a specific message.
*
* @param messageId The ID of the message to fetch attachments for.
*/
getAttachments(messageId: string): EmailApiClientResponseAttachments;
/**
* Marks a specific message as read.
*
* @param messageId The ID of the message to mark as read.
*/
markMessageAsRead(messageId: string): EmailApiClientResponseMarkMessageAsRead;
}
EmailApiClientAttachment
interface EmailApiClientAttachment {
/**
* Unique attachment ID
*/
id: string | null;
/**
* Filename of the attachment
*/
filename: string | null;
/**
* MIME type of the attachment
*/
mimeType: string | null;
/**
* Size of the file in bytes
*/
size: number | null;
/**
* Base64-encoded content of the attachment
*/
base64String: string | null;
/**
* Content ID for inline attachments (e.g. images)
*/
contentId: string | null;
/**
* Provider-specific raw attachment data
*/
rawData: object;
}
EmailApiClientConfig
interface EmailApiClientConfig {
/**
* ID of the email account to connect
*/
accountId: string;
}
EmailApiClientFolder
interface EmailApiClientFolder {
/**
* Unique ID of the folder, null if not applicable
*/
id: string | null;
/**
* Folder name, null if not available
*/
name: string | null;
/**
* Provider-specific raw folder data
*/
rawData: object;
}
EmailApiClientMessage
interface EmailApiClientMessage {
/**
* Unique message ID
*/
id: string | null;
/**
* Conversation/thread ID
*/
conversationId: string | null;
/**
* Unix timestamp of when the message was created
*/
dateCreated: number | null;
/**
* Whether the message has attachments
*/
hasAttachments: boolean | null;
/**
* Sender address
*/
from: string | null;
/**
* List of recipient addresses in "To" field
*/
to: [string] | null;
/**
* List of recipient addresses in "Cc" field
*/
cc: [string] | null;
/**
* List of recipient addresses in "Bcc" field
*/
bcc: [string] | null;
/**
* Subject of the message
*/
subject: string | null;
/**
* Plain text body
*/
bodyText: string | null;
/**
* HTML body
*/
bodyHtml: string | null;
/**
* Provider-specific raw message data
*/
rawData: object;
}
EmailApiClientMessages
interface EmailApiClientMessages {
/**
* Token to retrieve the next page of messages; null/false if no more pages
*/
nextPageToken: string | null | false;
/**
* List of messages
*/
values: EmailApiClientMessagesItem[];
}
EmailApiClientMessagesItem
interface EmailApiClientMessagesItem {
/**
* Unique message ID
*/
id: string | null;
/**
* Conversation/thread ID
*/
conversationId: string | null;
/**
* Provider-specific raw message data
*/
rawData: object;
}
EmailApiClientResponse
/**
* Generic response returned by the Email API client.
*/
interface EmailApiClientResponse {
/**
* Indicates whether the request was successful.
*/
isOk: boolean;
/**
* HTTP status code returned by the API.
*/
statusCode: number;
/**
* Data returned by the API. Can be one of several types depending on the request.
*/
data: EmailApiClientFolder[] | EmailApiClientMessages | EmailApiClientMessage | EmailApiClientAttachment[] | null;
/**
* Error message if the request failed.
*/
errorMessage: string | null;
}
EmailApiClientResponseAttachments
/**
* Response containing a list of attachments.
*/
interface EmailApiClientResponseAttachments extends EmailApiClientResponse {
/**
* List of attachments or null if none.
*/
data: EmailApiClientAttachment[] | null;
}
EmailApiClientResponseFolders
/**
* Response containing a list of folders.
*/
interface EmailApiClientResponseFolders extends EmailApiClientResponse {
/**
* List of folders or null if none.
*/
data: EmailApiClientFolder[] | null;
}
EmailApiClientResponseMarkMessageAsRead
/**
* Response returned when marking a message as read.
*/
interface EmailApiClientResponseMarkMessageAsRead extends EmailApiClientResponse {
/**
* Always null since no data is returned.
*/
data: null;
}
EmailApiClientResponseMessage
/**
* Response containing a single message.
*/
interface EmailApiClientResponseMessage extends EmailApiClientResponse {
/**
* Single message data or null if not found.
*/
data: EmailApiClientMessage | null;
}
EmailApiClientResponseMessages
/**
* Response containing a list of messages.
*/
interface EmailApiClientResponseMessages extends EmailApiClientResponse {
/**
* Messages data or null if none.
*/
data: EmailApiClientMessages | null;
}
EmailSignature
interface EmailSignature {
/**
* Unique ID of the signature
*/
id: number;
/**
* Display name of the signature
*/
name: string;
/**
* Signature content (HTML or plain text)
*/
signature: string;
}
Expression
/**
* Arbitrary SQL fragment with optional bound parameters.
*/
type Expression = {
__expr__: string,
__params__?: object,
}
FileInfo
interface FileInfo {
/**
* Unique identifier of the file.
*/
id: string;
/**
* File name including its extension (e.g., "document.pdf").
*/
name: string;
/**
* File extension without the dot (e.g., "pdf", "png").
*/
extension: string;
/**
* File size in bytes.
*/
size: number;
/**
* MIME type of the file (e.g., "application/pdf", "image/png").
*/
mimeType: string;
/**
* True if the file is an image format.
*/
isImage: boolean;
/**
* True if the file is a video format.
*/
isVideo: boolean;
/**
* True if the file is publicly accessible via a direct link.
*/
isPublic: boolean;
}
GoSignGetPackageParams
interface GoSignGetPackageParams {
/** Include the list of recipients in the response */
includeRecipients?: boolean;
/** Include the list of documents in the response */
includeDocuments?: boolean;
/** Include the list of fields in the response */
includeFields?: boolean;
}
HashCondition
/**
* Simple hash‑style condition object (e.g., {id: 5, status: 'ok'}).
*/
type HashCondition = object;
/**
* Represents a collection of HTTP headers where each key maps to an array of values.
*/
interface HeaderCollection {
[name: string]: string[];
}
InValidatorOptions
interface InValidatorOptions extends BaseValidatorOptions {
/**
* A list of valid values that the attribute value should be among.
*/
range: any[];
/**
* Whether the comparison is strict (both type and value must be the same).
*/
strict?: boolean;
/**
* Whether to invert the validation logic.
*/
not?: boolean;
}
JwtPayload
interface JwtPayload {
/**
* Identifies principal that issued the JWT
*/
iss?: any;
/**
* Identifies the subject of the JWT.
*/
sub?: any;
/**
* Identifies the recipients that the JWT is intended for
*/
aud?: any;
/**
* Identifies the time at which the JWT was issued
*/
iat?: number;
/**
* Identifies the time on which the JWT will start to be accepted for processing
*/
nbf?: number;
/**
* Identifies the expiration time on and after which the JWT must not be accepted for processing
*/
exp?: number;
}
JwtVerificationOptions
interface JwtVerificationOptions {
/**
* If true do not validate the expiration of the token
*/
ignoreExpiration?: boolean;
/**
* If true do not validate the start time of the token
*/
ignoreNotBefore?: boolean;
}
interface Metadata {
/**
* Unique identifier of the object.
*/
id: number;
/**
* Type of the metadata object.
*/
type: string;
/**
* Name of the object.
*/
name: string;
/**
* Script alias of the object.
*/
scriptAlias: string;
/**
* Description of the object.
*/
description: string;
/**
* Whether the current user can view the object.
*/
canView: boolean;
/**
* Whether the current user can insert the object.
*/
canInsert: boolean;
/**
* Whether the current user can update the object.
*/
canUpdate: boolean;
/**
* Whether the current user can delete the object.
*/
canDelete: boolean;
/**
* Whether the current user can export the object.
*/
canExport: boolean;
/**
* Whether the object allows attached files.
*/
attachFiles: boolean;
/**
* Base URL for the object.
*/
baseUrl: string | null;
/**
* Absolute base URL for the object.
*/
absoluteBaseUrl: string | null;
/**
* @deprecated Use param {include: [E8App.$metadata.T_ENUMERATION_VALUE]} of E8App.$metadata.get method to retrieve enumeration values.
*/
values?: object;
/**
* Child metadata objects.
*/
children?: Metadata[];
/**
* Owner metadata object, if any.
*/
owner: Metadata | null;
}
interface MetadataObjectParams extends MetadataParams {
/**
* List of fields or related objects to include.
*/
include?: string[];
}
interface MetadataParams {
}
NumberValidatorOptions
interface NumberValidatorOptions extends BaseValidatorOptions {
/**
* Lower limit of the number.
*/
min?: number;
/**
* Upper limit of the number.
*/
max?: number;
/**
* Whether the attribute value can only be an integer.
*/
integerOnly?: boolean;
}
Pdf
interface Pdf {
/**
* Adds a barcode to the PDF page.
*
* @param config Barcode configuration
*/
addBarcode(config: PdfBarcodeConfig): boolean;
/**
* Draws a circle on the PDF page.
*
* @param config Circle configuration
*/
addCircle(config: PdfCircleConfig): boolean;
/**
* Adds an image to the PDF page.
*
* @param config Image configuration
*/
addImage(config: PdfImageConfig): boolean;
/**
* Draws a line on the PDF page.
*
* @param config Line configuration
*/
addLine(config: PdfLineConfig): boolean;
/**
* Draws a rectangle on the PDF page.
*
* @param config Rectangle configuration
*/
addRect(config: PdfRectConfig): boolean;
/**
* Draws a rounded rectangle on the PDF page.
*
* @param config Rounded rectangle configuration
*/
addRoundedRect(config: PdfRoundedRectConfig): boolean;
/**
* Adds text to the PDF page.
*
* @param config Text configuration
*/
addText(config: PdfTextConfig): boolean;
/**
* Adds a new blank page to the PDF.
*/
addPage(): void;
/**
* Clips content to a circular path.
*
* @param config Circle configuration
*/
clipCircle(config: PdfCircleConfig): boolean;
/**
* Clips content to a rectangular path.
*
* @param config Rectangle configuration
*/
clipRect(config: PdfRectConfig): boolean;
/**
* Clips content to a rounded rectangle path.
*
* @param config Rounded rectangle configuration
*/
clipRoundedRect(config: PdfRoundedRectConfig): boolean;
/**
* Returns alpha value from 0 (transparent) to 1 (opaque)
*/
getAlpha(): number;
/**
* Returns all errors occurred during PDF operations
*/
getErrors(): string[];
/**
* Returns the HEX-color used for all filling operations
*/
getFillColor(): string;
/**
* Returns the current font object
*/
getFont(): PdfFont;
/**
* Returns the current font size in points
*/
getFontSize(): number;
/**
* Returns the current font style
*/
getFontStyle(): PdfFontStyle;
/**
* Returns the current font weight
*/
getFontWeight(): PdfFontWeight;
/**
* Returns the current page format
*/
getFormat(): PdfFormat;
/**
* Returns the last error message or null
*/
getLastError(): string | null;
/**
* Returns the current page orientation
*/
getOrientation(): PdfOrientation;
/**
* Returns the current line width
*/
getLineWidth(): number;
/**
* Returns the total number of pages in the PDF
*/
getPageCount(): number;
/**
* Returns the current page number
*/
getPage(): number;
/**
* Returns the size of a specific page
*
* @param page Page number (optional, current page by default)
*/
getPageSize(page?: number): PdfSize | null;
/**
* Returns the sizes of all pages
*/
getPageSizes(): PdfSize[];
/**
* Returns the height of a page
*
* @param page Page number (optional, current page by default)
*/
getPageHeight(page?: number): number | null;
/**
* Returns the width of a page
*
* @param page Page number (optional, current page by default)
*/
getPageWidth(page?: number): number | null;
/**
* Returns the HEX-color used for all drawing operations
*/
getStrokeColor(): string;
/**
* Returns the HEX-color used for all text
*/
getTextColor(): string;
/**
* Returns all text decorations applied
*/
getTextDecoration(): PdfTextDecoration[];
/**
* Returns the current measurement unit
*/
getUnit(): PdfUnit;
/**
* Checks if a specific page exists
*
* @param page Page number
*/
hasPage(page: number): boolean;
/**
* Checks if the PDF has any pages
*/
hasPages(): boolean;
/**
* Rotates content on the page
*
* @param config Rotation configuration
*/
rotate(config: PdfRotationConfig): boolean;
/**
* Imports an external PDF file.
*
* @param file File path or uploaded file
* @param pages Optional list of pages to import
*/
importFile(file: string | UploadedFile, pages?: number[]): boolean;
/**
* Saves the PDF to a file
*
* @param basename Optional file base name
*/
save(basename?: string): FileInfo | null;
/**
* Sets alpha value for drawing and filling
*
* @param alpha Alpha value (0-1)
*/
setAlpha(alpha: number): boolean;
/**
* Sets the HEX-color used for filling
*
* @param color Fill color in HEX
*/
setFillColor(color: string): boolean;
/**
* Sets the current font
*
* @param font Font object
*/
setFont(font: PdfFont): boolean;
/**
* Sets font size in points
*
* @param size Font size
*/
setFontSize(size: number): boolean;
/**
* Sets the font style
*
* @param style Font style
*/
setFontStyle(style: PdfFontStyle): boolean;
/**
* Sets the font weight
*
* @param weight Font weight
*/
setFontWeight(weight: PdfFontWeight): boolean;
/**
* Sets page format
*
* @param format Page format
*/
setFormat(format: PdfFormat): boolean;
/**
* Sets line width
*
* @param width Line width
*/
setLineWidth(width: number): boolean;
/**
* Sets page orientation
*
* @param orientation Page orientation
*/
setOrientation(orientation: PdfOrientation): boolean;
/**
* Sets the current page
*
* @param page Page number
*/
setPage(page: number): boolean;
/**
* Sets PDF protection options
*
* @param config Protection configuration
*/
setProtection(config: PdfProtectionConfig): boolean;
/**
* Adds a signature to the PDF
*
* @param signature Signature configuration
*/
setSignature(signature: PdfSignatureConfig): boolean;
/**
* Sets the HEX-color for drawing
*
* @param color Stroke color in HEX
*/
setStrokeColor(color: string): boolean;
/**
* Sets the HEX-color for text
*
* @param color Text color in HEX
*/
setTextColor(color: string): boolean;
/**
* Sets text decorations
*
* @param decoration Text decoration(s)
*/
setTextDecoration(decoration: PdfTextDecoration | PdfTextDecoration[]): boolean;
/**
* Sets the measurement unit
*
* @param unit Unit type
*/
setUnit(unit: PdfUnit): boolean;
/**
* Starts a new transformation block
*/
startTransform(): boolean;
/**
* Ends the current transformation block
*/
stopTransform(): boolean;
}
PdfBarcodeConfig
interface PdfBarcodeConfig {
/**
* Type of barcode (e.g., CODE128, QR)
*/
type: string;
/**
* Value encoded in the barcode
*/
value: string;
/**
* Whether to display the barcode value as text
*/
showText: boolean;
/**
* X-coordinate on the PDF page
*/
x: number;
/**
* Y-coordinate on the PDF page
*/
y: number;
/**
* Width of the barcode
*/
width: number;
/**
* Height of the barcode
*/
height: number;
/**
* Whether to fill the barcode area
*/
fill: boolean;
}
PdfCircleConfig
interface PdfCircleConfig {
/**
* X-coordinate of the circle center
*/
x: number;
/**
* Y-coordinate of the circle center
*/
y: number;
/**
* Radius of the circle
*/
radius: number;
/**
* Whether to stroke the circle outline
*/
stroke: boolean;
/**
* Whether to fill the circle
*/
fill: boolean;
}
PdfFont
type PdfFont =
| 'Courier'
| 'Helvetica'
| 'Homemade Apple'
| 'OCRA'
| 'Roboto'
| 'Source Sans Pro'
| 'Symbol'
| 'Times New Roman';
PdfFontStyle
type PdfFontStyle = 'normal' | 'italic';
PdfFontWeight
type PdfFontWeight = 'normal' | 'bold';
type PdfFormat =
| 'LETTER'
| 'LEGAL'
| 'EXECUTIVE'
| 'A3'
| 'A4'
| 'A5'
| 'A6'
| 'FOLIO'
| PdfSize;
PdfImageConfig
interface PdfImageConfig {
/**
* Source path or URL of the image
*/
source: string;
/**
* X-coordinate of the image on the page
*/
x: number;
/**
* Y-coordinate of the image on the page
*/
y: number;
/**
* Width of the image
*/
width: number;
/**
* Height of the image
*/
height: number;
}
PdfLineConfig
interface PdfLineConfig {
/**
* X-coordinate of the line start
*/
x1: number;
/**
* Y-coordinate of the line start
*/
y1: number;
/**
* X-coordinate of the line end
*/
x2: number;
/**
* Y-coordinate of the line end
*/
y2: number;
}
PdfOrientation
type PdfOrientation = 'PORTRAIT' | 'LANDSCAPE';
PdfProtectionConfig
interface PdfProtectionConfig {
/**
* Set of permissions (specify the ones you want to block)
*/
permissions?: string[];
/**
* If you set a user password, the PDF viewer will ask for it before displaying the document
*/
userPassword?: string;
/**
* The owner password, if different from the user one, can be used to get full access.
* If not specified, a random value is used
*/
ownerPassword?: string;
/**
* Encryption strength (default, MODE_AES_256)
*/
mode?: string;
}
PdfRectConfig
interface PdfRectConfig {
/**
* X-coordinate of the rectangle
*/
x: number;
/**
* Y-coordinate of the rectangle
*/
y: number;
/**
* Width of the rectangle
*/
width: number;
/**
* Height of the rectangle
*/
height: number;
/**
* Whether to stroke the rectangle outline
*/
stroke: boolean;
/**
* Whether to fill the rectangle
*/
fill: boolean;
}
PdfRotationConfig
interface PdfRotationConfig {
/**
* Rotation angle in degrees
*/
angle: number;
/**
* X-coordinate of the rotation origin
*/
x: number;
/**
* Y-coordinate of the rotation origin
*/
y: number;
}
PdfRoundedRectConfig
interface PdfRoundedRectConfig extends PdfRectConfig {
/**
* Corner radius of the rectangle
*/
radius: number;
}
PdfSignatureConfig
interface PdfSignatureConfig {
/**
* Path to the signature file
*/
file: string;
/**
* Name of the signer
*/
name?: string;
/**
* Location of signing
*/
location?: string;
/**
* Reason for signing
*/
reason?: string;
/**
* Contact information for the signer
*/
contactInfo?: string;
}
PdfSize
interface PdfSize {
readonly width: number;
readonly height: number;
}
PdfTextConfig
interface PdfTextConfig {
/**
* Text content to render
*/
text: string;
/**
* X-coordinate of the text
*/
x: number;
/**
* Y-coordinate of the text
*/
y: number;
/**
* Width of the text area
*/
width: number;
/**
* Height of the text area (optional)
*/
height?: number;
/**
* Horizontal alignment: left, center, right
*/
hAlign?: string;
/**
* Vertical alignment: top, middle, bottom
*/
vAlign?: string;
}
PdfTextDecoration
type PdfTextDecoration = 'normal' | 'underline' | 'line-through' | 'overline';
PdfTextField
interface PdfTextField {
/**
* The page number where the text field is located
*/
page: number;
/**
* X-coordinate of the text field (in PDF units)
*/
x: number;
/**
* Y-coordinate of the text field (in PDF units)
*/
y: number;
/**
* The text content of the field
*/
text: string;
/**
* Font size of the text. Null if default font size is used
*/
fontSize: number | null;
}
PdfUnit
type PdfUnit = 'in' | 'pt' | 'mm' | 'cm' | 'px';
PluginAccessToken
interface PluginAccessToken {
/**
* Generates an access token for a given user.
*
* @param userId The ID of the user to get the token for.
*/
getToken(userId: number): string;
/**
* Returns a login URL for a given user.
*
* @param userId The ID of the user to generate the login URL for.
*/
getLoginUrl(userId: number): string;
}
PluginPdf
interface PluginPdf {
/**
* Inches
*/
readonly UNIT_IN: 'in';
/**
* Points
*/
readonly UNIT_PT: 'pt';
/**
* Millimeters
*/
readonly UNIT_MM: 'mm';
/**
* Centimeters
*/
readonly UNIT_CM: 'cm';
/**
* Pixels
*/
readonly UNIT_PX: 'px';
readonly FORMAT_LETTER: 'LETTER';
readonly FORMAT_LEGAL: 'LEGAL';
readonly FORMAT_EXECUTIVE: 'EXECUTIVE';
readonly FORMAT_A3: 'A3';
readonly FORMAT_A4: 'A4';
readonly FORMAT_A5: 'A5';
readonly FORMAT_A6: 'A6';
readonly FORMAT_FOLIO: 'FOLIO';
readonly ORIENTATION_PORTRAIT: 'PORTRAIT';
readonly ORIENTATION_LANDSCAPE: 'LANDSCAPE';
readonly FONT_COURIER: 'Courier';
readonly FONT_HELVETICA: 'Helvetica';
readonly FONT_HOMEMADE_APPLE: 'Homemade Apple';
readonly FONT_OCRA: 'OCRA';
readonly FONT_ROBOTO: 'Roboto';
readonly FONT_SOURCE_SANS_PRO: 'Source Sans Pro';
readonly FONT_SYMBOL: 'Symbol';
readonly FONT_TIMES: 'Times New Roman';
readonly FONT_STYLE_NORMAL: 'normal';
readonly FONT_STYLE_ITALIC: 'italic';
readonly FONT_WEIGHT_NORMAL: 'normal';
readonly FONT_WEIGHT_BOLD: 'bold';
readonly TEXT_DECORATION_NORMAL: 'normal';
readonly TEXT_DECORATION_UNDERLINE: 'underline';
readonly TEXT_DECORATION_LINE_THROUGH: 'line-through';
readonly TEXT_DECORATION_OVERLINE: 'overline';
readonly HORIZONTAL_ALIGNMENT_LEFT: 'left';
readonly HORIZONTAL_ALIGNMENT_CENTER: 'center';
readonly HORIZONTAL_ALIGNMENT_RIGHT: 'right';
readonly HORIZONTAL_ALIGNMENT_JUSTIFY: 'justify';
readonly VERTICAL_ALIGNMENT_TOP: 'top';
readonly VERTICAL_ALIGNMENT_MIDDLE: 'middle';
readonly VERTICAL_ALIGNMENT_BOTTOM: 'bottom';
/**
* Encryption strength RC4 40 bit
*/
readonly MODE_RC4_40: string;
/**
* Encryption strength RC4 128 bit
*/
readonly MODE_RC4_128: string;
/**
* Encryption strength AES 128 bit
*/
readonly MODE_AES_128: string;
/**
* Encryption strength AES 256 bit
*/
readonly MODE_AES_256: string;
/**
* Permission to print the document
*/
readonly PERMISSION_PRINT: string;
/**
* Permission to modify the document contents
*/
readonly PERMISSION_MODIFY: string;
/**
* Permission to copy or extract text and graphics
*/
readonly PERMISSION_COPY: string;
/**
* Permission to add or modify text annotations and form fields
*/
readonly PERMISSION_ANNOT_FORMS: string;
/**
* Permission to fill existing interactive form fields
*/
readonly PERMISSION_FILL_FORMS: string;
/**
* Permission to extract text and graphics for accessibility
*/
readonly PERMISSION_EXTRACT: string;
/**
* Permission to assemble the document (insert, rotate, delete pages, etc.)
*/
readonly PERMISSION_ASSEMBLE: string;
/**
* Permission to print a high-fidelity version of the document
*/
readonly PERMISSION_PRINT_HIGH: string;
/**
* Creates a new PDF document instance.
*/
create(): Pdf;
/**
* Extracts text from a PDF file or uploaded PDF.
*
* @param id PDF file ID or uploaded file
*/
extractText(id: string | UploadedFile): string | null;
/**
* Extracts all text fields from a PDF file or uploaded PDF.
*
* @param id PDF file ID or uploaded file
*/
extractTextFields(id: string | UploadedFile): PdfTextField[] | null;
}
/**
* Parameters used to generate or display a print form.
*/
interface PrintFormParams {
/**
* Full file name (with extension) to use for the generated file.
* If both 'filename' and 'basename' are provided, 'basename' takes priority.
*/
basename?: string;
/**
* File name without extension. The file extension will PDF
*/
filename?: string;
}
/**
* Result returned after generating a print form.
*/
interface PrintFormResult {
/**
* Unique identifier of the print form.
*/
id: string;
/**
* Text content of the form (e.g., HTML or plain text).
*/
text: string,
/**
* Primary recipients of the form.
*/
to: Recipient[];
/**
* Carbon copy recipients of the form.
*/
cc: Recipient[];
/**
* Blind carbon copy recipients of the form.
*/
bcc: Recipient[];
}
Profile
/**
* Represents the stored profile information of a user.
*/
interface Profile {
/**
* The first name of the user, or null if not set.
*/
firstName: string | null;
/**
* The last name of the user, or null if not set.
*/
lastName: string | null;
/**
* The user's date of birth in ISO format (YYYY-MM-DD), or null if not set.
*/
dateOfBirth: string | null;
/**
* The preferred locale of the user (e.g., "en-US", "fr-FR"), or null if not set.
*/
locale: string | null;
}
ProfileData
/**
* Represents optional profile details that can be set or updated for a user.
*/
interface ProfileData {
/**
* The first name of the user.
*/
firstName?: string;
/**
* The last name of the user.
*/
lastName?: string;
/**
* The user's date of birth in ISO format (YYYY-MM-DD).
*/
dateOfBirth?: string;
/**
* The preferred locale of the user (e.g., "en-US", "fr-FR").
*/
locale?: string;
}
PublicFileParams
interface PublicFileParams {
/**
* Target directory
*/
dir?: string;
}
Query
/**
* Builder for SELECT‑style queries.
*/
interface Query extends BaseQuery {
/**
* Set a named parameter.
*
* @param name The name of the parameter.
* @param value The value to assign to the parameter.
*/
setParam(name: string, value: any): Query;
/**
* Set multiple parameters at once.
*
* @param params An object containing key-value pairs of parameters.
*/
setParams(params: object): Query;
/**
* Define SELECT columns.
*
* @param columns The columns or expressions to select.
*/
select(columns: SelectExpression): Query;
/**
* Append columns to the existing SELECT list.
*
* @param column The column or expression to add.
*/
addSelect(column: SelectExpression): Query;
/**
* Specify the FROM table.
*
* @param table The table to select from.
*/
from(table: Table): Query;
/**
* LEFT JOIN with a condition.
*
* @param table The table to join.
* @param on The join condition.
*/
leftJoin(table: Table, on: Conditions): Query;
/**
* RIGHT JOIN with a condition.
*
* @param table The table to join.
* @param on The join condition.
*/
rightJoin(table: Table, on: Conditions): Query;
/**
* INNER JOIN with a condition.
*
* @param table The table to join.
* @param on The join condition.
*/
innerJoin(table: Table, on: Conditions): Query;
/**
* Apply a WHERE clause.
*
* @param conditions The conditions for the WHERE clause.
*/
where(conditions: Conditions): Query;
/**
* Add an AND condition to WHERE.
*
* @param conditions The conditions to append with AND.
*/
andWhere(conditions: Conditions): Query;
/**
* Add an OR condition to WHERE.
*
* @param conditions The conditions to append with OR.
*/
orWhere(conditions: Conditions): Query;
/**
* ORDER BY (string, Expression, or array).
*
* @param orderBy The column(s) or expression(s) to order by.
* @param direction Optional. The direction ('ASC' or 'DESC').
*/
orderBy(orderBy: string | Expression | any[], direction?: string): Query;
/**
* ORDER BY using an object map {column: direction}.
*
* @param orderBy Object mapping columns to directions.
*/
orderBy(orderBy: object): Query;
/**
* Append another ORDER BY clause.
*
* @param orderBy The column(s) or expression(s) to append.
* @param direction Optional. The direction ('ASC' or 'DESC').
*/
addOrderBy(orderBy: string | Expression | any[], direction?: string): Query;
/**
* Append ORDER BY via object map.
*
* @param orderBy Object mapping columns to directions.
*/
addOrderBy(orderBy: object): Query;
/**
* GROUP BY clause.
*
* @param groupBy Column(s) or expression(s) to group by.
*/
groupBy(groupBy: string | Expression | any[]): Query;
/**
* Append additional GROUP BY fields.
*
* @param groupBy Column(s) or expression(s) to add.
*/
addGroupBy(groupBy: string | Expression | any[]): Query;
/**
* HAVING clause.
*
* @param conditions Conditions for the HAVING clause.
*/
having(conditions: Conditions): Query;
/**
* Add an AND HAVING condition.
*
* @param conditions Conditions to append with AND.
*/
andHaving(conditions: Conditions): Query;
/**
* Add an OR HAVING condition.
*
* @param conditions Conditions to append with OR.
*/
orHaving(conditions: Conditions): Query;
/**
* Limit number of rows.
*
* @param limit Maximum number of rows to return.
*/
limit(limit: number): Query;
/**
* Offset for pagination.
*
* @param offset Number of rows to skip.
*/
offset(offset: number): Query;
/**
* Toggle DISTINCT (default true).
*
* @param distinct Whether to apply DISTINCT.
*/
distinct(distinct?: boolean): Query;
/**
* UNION with another query.
*
* @param union The query to union with.
*/
union(union: Query): Query;
/**
* UNION ALL with another query.
*
* @param union The query to union all with.
*/
unionAll(union: Query): Query;
}
Recipient
interface Recipient {
/**
* Display name of the recipient.
*/
name: string;
/**
* Email address of the recipient.
*/
email: string;
}
RegexValidatorOptions
interface RegexValidatorOptions extends BaseValidatorOptions {
/**
* The regular expression to be matched with.
*/
pattern: string;
/**
* Whether to invert the validation logic.
*/
not?: boolean;
}
RequestCollection
/**
* Represents a collection of request parameters where each key maps to any value.
*/
interface RequestCollection {
[name: string]: any;
}
SelectExpression
/**
* SELECT target – a single column (or alias) or an array of them.
*/
type SelectExpression = Column | Column[];
SendContentAsFileOptions
interface SendContentAsFileOptions {
/** Whether the content should be displayed inline. */
inline?: boolean;
/** The MIME type of the content. */
mimeType?: string;
}
SendFileOptions
interface SendFileOptions {
/**
* Full file name (with extension) to use for the generated file.
* If both 'filename' and 'basename' are provided, 'basename' takes priority.
*/
basename?: string;
/** The file name to be used when sending. */
filename?: string;
/** Whether the file should be displayed inline. */
inline?: boolean;
/** The MIME type of the file. */
mimeType?: string;
}
SendPdfPageOptions
interface SendPdfPageOptions {
/** The DPI (dots per inch) to use when generating the PDF page. */
dpi?: number;
}
SFTPConnection
interface SFTPConnection {
/**
* Authenticates with provided username and password.
*
* @param username The username to log in with.
* @param password The password to log in with.
*/
login(username: string, password: string): boolean;
/**
* Returns the current directory name.
*/
getCurrentDirectory(): string | false;
/**
* Changes the current directory.
*
* @param dir The directory path to change to.
*/
setCurrentDirectory(dir: string): boolean;
/**
* Creates a directory.
*
* @param dir The path of the directory to create.
* @param recursive Optional. If true, creates directories recursively.
*/
createDirectory(dir: string, recursive?: boolean): boolean;
/**
* Set permissions on a directory or a file.
*
* @param path The file or directory path.
* @param mode The permission mode (e.g., 0o755).
* @param recursive Optional. If true, applies permissions recursively.
*/
chmod(path: string, mode: number, recursive?: boolean): boolean;
/**
* Renames a file or a directory on the SFTP server.
* If the file already exists this will return false.
*
* @param oldPath The current path of the file or directory.
* @param newPath The new path or name.
*/
rename(oldPath: string, newPath: string): boolean;
/**
* Returns a list of files in the current directory.
*/
getList(): string[] | false;
/**
* Canonicalizes the Server-Side Path Name.
*
* @param path The path to canonicalize.
*/
getRealPath(path: string): string | false;
/**
* Returns general information about a file.
*
* @param path The file path.
*/
getStat(path: string): object | false;
/**
* Downloads a file from the SFTP server.
*
* @param path The path of the file to download.
*/
get(path: string): FileInfo | false;
/**
* Returns a file content from the SFTP server.
*
* @param path The path of the file.
*/
getContent(path: string): string | false;
/**
* Uploads a file to the SFTP server.
*
* @param id The file identifier.
* @param path The local path of the file to upload.
*/
put(id: string, path: string): boolean;
/**
* Deletes a file on the SFTP server.
*
* @param path The path of the file or directory.
* @param recursive Optional. If true, deletes recursively.
*/
delete(path: string, recursive?: boolean): boolean;
/**
* Returns all errors.
*/
getErrors(): string[];
/**
* Returns the last error.
*/
getLastError(): string | null;
}
SFTPConnectionConfig
interface SFTPConnectionConfig {
/**
* The hostname or IP address of the SFTP server.
*/
host: string;
/**
* Optional. The port number to connect to. Defaults to 22 if not provided.
*/
port?: number;
/**
* Optional. The connection timeout in milliseconds.
*/
timeout?: number;
}
StringValidatorOptions
interface StringValidatorOptions extends BaseValidatorOptions {
/**
* Minimum length.
*/
min?: number;
/**
* Maximum length.
*/
max?: number;
}
Table
/**
* Table reference – plain name or an aliased definition.
*/
type Table = string | TableWithAlias;
TableWithAlias
/**
* Alias → table name or sub‑query (virtual table).
*/
type TableWithAlias = {
[key: string]: string | Query
};
ThumbnailFileParams
interface ThumbnailFileParams {
/**Keep original aspect ratio */
keepAspectRatio?: boolean;
}
UploadedFile
/**
* Represents a file uploaded in an HTTP request.
*/
interface UploadedFile {
/** The base name of the file. */
basename: string;
/** The size of the file in bytes. */
readonly size: number;
/** The MIME type of the file. */
readonly mimeType: string;
}
User
interface User {
/**
* Unique identifier of the user
*/
id: string;
/**
* Username of the user
*/
username: string;
/**
* Email address of the user
*/
email: string;
/**
* Indicates if the user has administrative privileges
*/
isAdmin: boolean;
/**
* Indicates if the user account is blocked
*/
isBlocked: boolean;
/**
* Indicates if the user must change password on next login
*/
forcePasswordChange: boolean;
}
UserData
/**
* Represents the basic data required to create or update a user account.
*/
interface UserData {
/**
* The unique username for the user.
*/
username?: string;
/**
* The email address of the user.
*/
email?: string;
/**
* The password for the user account.
*/
password?: string;
/**
* Indicates whether the user must change their password on next login.
*/
forcePasswordChange?: boolean;
}
UserParams
interface UserParams {
/**
* Whether to send a welcome message to the user
*/
sendWelcomeMessage?: boolean;
/**
* Whether to generate an access token for the user
*/
generateAccessToken?: boolean;
}
Validator
interface Validator {
/**
* Adds a validation rule to one or more attributes.
*
* @param attributes Attribute name or array of attribute names
* @param validator Validator type or custom validator name
* @param options Optional validator-specific options
*/
addRule(
attributes: string | string[],
validator: string,
options?: object,
): Validator;
/**
* Adds a string validation rule.
*
* @param attributes Attribute name or array of attribute names
* @param validator 'string'
* @param options String validator options
*/
addRule(
attributes: string | string[],
validator: 'string',
options?: StringValidatorOptions,
): Validator;
/**
* Adds a number validation rule.
*
* @param attributes Attribute name or array of attribute names
* @param validator 'number'
* @param options Number validator options
*/
addRule(
attributes: string | string[],
validator: 'number',
options?: NumberValidatorOptions,
): Validator;
/**
* Adds a regex validation rule.
*
* @param attributes Attribute name or array of attribute names
* @param validator 'regex'
* @param options Regex validator options
*/
addRule(
attributes: string | string[],
validator: 'regex',
options: RegexValidatorOptions,
): Validator;
/**
* Adds an 'in' validation rule (value must be in a set).
*
* @param attributes Attribute name or array of attribute names
* @param validator 'in'
* @param options In validator options
*/
addRule(
attributes: string | string[],
validator: 'in',
options: InValidatorOptions,
): Validator;
/**
* Adds a callback validation rule.
*
* @param attributes Attribute name or array of attribute names
* @param validator 'callback'
* @param options Callback validator options
*/
addRule(
attributes: string | string[],
validator: 'callback',
options: CallbackValidatorOptions,
): Validator;
/**
* Returns the data to be validated.
*/
getData(): object;
/**
* Returns all validation errors.
*/
getErrors(): string[];
/**
* Returns labels for the attributes.
*/
getLabels(): object;
/**
* Returns the last validation error.
*/
getLastError(): string | null;
/**
* Validates the data according to added rules.
*/
validate(): boolean;
}
ValidatorCallback
type ValidatorCallback = (value: any) => boolean;
WebSocketUrlConfig
interface WebSocketUrlConfig {
/**
* Refers to a specific channel or subject that messages are organized around.
*/
topic: string;
/**
* Refers to the identification of a session between a client and a server.
*/
identity?: any;
/**
* Refers to the duration in seconds after which a URL will no longer be valid.
* The default value is 3600 seconds (1 hour).
*/
expiresIn?: number;
}