Function Reference

apigwBody

Name Description I/O

Read request body from integration gateway

Parameters:
  • * request ( HttpRequest,)

Results:
  • body (String)

Read file from integration gateway

Parameters:
  • * request ( HttpRequest,)

  • * name ( String,)

Results:
  • file (Reader)

  • fileName (String)

  • exists (Boolean)

corredor

Name Description I/O

Corredor automation script executor

Executes script in Corredor Automation server

Parameters:
  • * script ( String,)

  • args ( Vars,)

Results:
  • results (Vars)

email

Name Description I/O

Email

Sends email directly

Parameters:
  • Subject ( String, Reader,)

  • Reply to ( String, User,)

  • Sender ( String, User,)

  • Recipients ( String, KV, User,)

  • CC ( String, KV, User,)

  • HTML message body ( String, Reader,)

  • Plain text message body ( String, Reader,)

Email builder

Constructs new email message from basic parameters without sending it

Parameters:
  • Subject ( String, Reader,)

  • Reply to ( String, User,)

  • Sender ( String, User,)

  • Recipients ( String, KV, User,)

  • CC ( String, KV, User,)

  • HTML message body ( String, Reader,)

  • Plain text message body ( String, Reader,)

Results:
  • message (EmailMessage)

Email sender

Sends email message

Parameters:
  • * Message to be sent ( EmailMessage,)

Email subject

Sets subject on the email message

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Subject ( String,)

Email headers

Sets message headers (overrides any existing headers, subject, recipients)

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Headers ( KVV,)

Email header

Sets or removes specific header without changing the rest

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Value ( String,)

  • Value ( String,)

Email set address

Sets the recipient, sender or reply-to addresses

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Type ( String,)

  • * Address ( String,)

  • Name ( String,)

Email add address

Adds new recipient, sender or reply-to address

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Type ( String,)

  • * Address ( String,)

  • Name ( String,)

Email attachment

Attach content to an email message

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Content ( Reader, String,)

  • Name ( String,)

Email embedded attachment

Embed file (image) to an email message

Parameters:
  • * Message to be sent ( EmailMessage,)

  • * Content ( Reader,)

  • Name ( String,)

httpRequest

Name Description I/O

HTTP request

Sends HTTP requests

Parameters:
  • * url ( String,)

  • * method ( String,)

  • params ( KVV,)

  • headers ( KVV,)

  • headerAuthBearer ( String,)

  • headerAuthUsername ( String,)

  • headerAuthPassword ( String,)

  • headerUserAgent ( String,)

  • headerContentType ( String,)

  • timeout ( Duration,)

  • form ( KVV,)

  • body ( String, Reader, Any,)

Results:
  • status (String)

  • statusCode (Integer)

  • headers (KVV)

  • contentLength (Integer)

  • contentType (String)

  • body (Reader)

jsenv

Name Description I/O

Process arbitrary data in jsenv

Parameters:
  • * scope ( Any, Reader,)

  • * source ( String,)

Results:
  • resultString (String)

  • resultInt (Integer)

  • resultBool (Boolean)

  • resultAny (Any)

jwt

Name Description I/O

Generate JWT

Parameters:
  • scope ( String,)

  • * header ( Vars, String,)

  • * payload ( Vars, String,)

  • * secret ( String, Reader,)

Results:
  • token (String)

log

Name Description I/O

Log debug message

Parameters:
  • * message ( String,)

  • fields ( KV,)

Log info message

Parameters:
  • * message ( String,)

  • fields ( KV,)

Log warning message

Parameters:
  • * message ( String,)

  • fields ( KV,)

Log error message

Parameters:
  • * message ( String,)

  • fields ( KV,)

loop

Name Description I/O

oauth2

Name Description I/O

Authentication: OAUTH2

Parameters:
  • * client ( String,)

  • * secret ( String,)

  • * scope ( String,)

  • * tokenUrl ( String,)

Results:
  • accessToken (String)

  • refreshToken (String)

  • token (Any)

queue

Name Description I/O

Queue message send

Parameters:
  • * payload ( String, Reader,)

  • * queue ( String,)

attachment

Name Description I/O

Attachment lookup

Find specific attachment by ID

Parameters:
  • * attachment ( ID,)

Results:
  • attachment (Attachment)

Create file and attach it to a resource

Parameters:
  • name ( String,)

  • * resource ( ComposeRecord,)

  • fieldName ( String,)

  • * content ( String, Reader, Bytes,)

Results:
  • attachment (Attachment)

Delete attachment

Parameters:
  • * attachment ( ID,)

Open original attachment

Parameters:
  • * attachment ( ID, Attachment,)

Results:
  • content (Reader)

Open attachment preview

Parameters:
  • * attachment ( ID, Attachment,)

Results:
  • content (Reader)

modules

Name Description I/O

Compose module lookup

Find specific module by ID or handle

Parameters:
  • * module ( ID, Handle, ComposeModule,)

  • * namespace ( ID, Handle, ComposeNamespace,)

Results:
  • module (ComposeModule)

namespaces

Name Description I/O

Compose namespace lookup

Find specific namespace by ID or handle

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

Results:
  • namespace (ComposeNamespace)

notification

Name Description I/O

Send record notification

Sends a notification that links to a specific record

Parameters:
  • * recipient ( ID, Handle, String,)

  • * title ( String,)

  • description ( String,)

  • * module ( ID, Handle,)

  • * namespace ( ID, Handle,)

  • record ( ID,)

  • openMode ( String,)

  • edit ( Boolean,)

records

Name Description I/O

Compose record lookup

Find specific record by ID

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

  • * record ( ID, ComposeRecord,)

Results:
  • record (ComposeRecord)

Compose records search

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

  • query ( String,)

  • meta ( Meta,)

  • deleted ( UnsignedInteger,)

  • sort ( String,)

  • limit ( UnsignedInteger,)

  • incTotal ( Boolean,)

  • incPageNavigation ( Boolean,)

  • pageCursor ( String,)

Results:
  • records (ComposeRecord)

  • Total records found (UnsignedInteger)

  • nextPage (String)

  • prevPage (String)

  • pageNavigation (Array)

Compose record lookup (oldest)

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

Results:
  • record (ComposeRecord)

Compose record lookup (newest)

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

Results:
  • record (ComposeRecord)

Compose record maker

Creates new compose record instance without saving it

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

Results:
  • record (ComposeRecord)

Compose record validator

Parameters:
  • * record ( ComposeRecord,)

Results:
  • Set to true when record is valid (Boolean)

Compose record create

Parameters:
  • * record ( ComposeRecord,)

Results:
  • record (ComposeRecord)

Compose record update

Parameters:
  • * record ( ComposeRecord,)

Results:
  • record (ComposeRecord)

Compose record delete

Parameters:
  • Module to set record type ( ID, Handle, ComposeModule,)

  • namespace ( ID, Handle, ComposeNamespace,)

  • * record ( ID, ComposeRecord,)

Report

Compose records report

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

  • * Metrics for records report ( String,)

  • * Dimensons for records report ( String,)

  • * Filter for records report ( String,)

Results:
  • Complex structure holding complete records report (Any)

Compose record cloner

Creates a copy of an existing record

Parameters:
  • * namespace ( ID, Handle, ComposeNamespace,)

  • * Module to set record type ( ID, Handle, ComposeModule,)

  • * record ( ID, ComposeRecord,)

Results:
  • record (ComposeRecord)

actionlog

Name Description I/O

Action log search

Parameters:
  • fromTimestamp ( DateTime,)

  • toTimestamp ( DateTime,)

  • beforeActionID ( ID,)

  • actorID ( ID,)

  • origin ( String,)

  • resource ( String,)

  • action ( String,)

  • limit ( UnsignedInteger,)

Results:
  • actions (Action)

Record action into action log

Parameters:
  • action ( String,)

  • resource ( String,)

  • error ( String,)

  • severity ( String,)

  • description ( String,)

  • meta ( Vars,)

notification

Name Description I/O

Send simple notification

Sends a simple notification with title and description to a user

Parameters:
  • * recipient ( ID, Handle, String,)

  • * title ( String,)

  • description ( String,)

rbac

Name Description I/O

RBAC: Allow operation on resource to a role

Parameters:
  • * resource ( RbacResource,)

  • * role ( ID, Handle, Role,)

  • * operation ( String,)

RBAC: Deny operation on resource to a role

Parameters:
  • * resource ( RbacResource,)

  • * role ( ID, Handle, Role,)

  • * operation ( String,)

RBAC: Remove allow/deny operation of a role from resource

Parameters:
  • * resource ( RbacResource,)

  • * role ( ID, Handle, Role,)

  • * operation ( String,)

RBAC: Can user perform an operation on a resource

Parameters:
  • * resource ( RbacResource,)

  • * operation ( String,)

  • user ( User,)

Results:
  • can (Boolean)

roles

Name Description I/O

Role lookup

Find specific role by ID or handle

Parameters:
  • * lookup ( ID, Handle, Role,)

Results:
  • role (Role)

Role members search

Find members for a specific roleby ID or handle

Parameters:
  • * lookup ( ID, Handle, Role,)

Results:
  • users (User)

  • total (UnsignedInteger)

Role membership add

Parameters:
  • * role ( ID, Handle, Role,)

  • * user ( ID, Handle, String, User,)

Role membership remove

Parameters:
  • * role ( ID, Handle, Role,)

  • * user ( ID, Handle, String, User,)

Roles search

Parameters:
  • query ( String,)

  • memberID ( ID,)

  • handle ( String,)

  • name ( String,)

  • labels ( KV,)

  • deleted ( UnsignedInteger,)

  • archived ( UnsignedInteger,)

  • sort ( String,)

  • limit ( UnsignedInteger,)

  • incTotal ( Boolean,)

  • incPageNavigation ( Boolean,)

  • pageCursor ( String,)

Results:
  • roles (Role)

  • total (UnsignedInteger)

Role creator

Parameters:
  • * role ( Role,)

Results:
  • role (Role)

Role update

Parameters:
  • * role ( Role,)

Results:
  • role (Role)

Role delete

Parameters:
  • * lookup ( ID, Handle, Role,)

Role recover

Parameters:
  • * lookup ( ID, Handle, Role,)

Role archive

Parameters:
  • * lookup ( ID, Handle, Role,)

Role unarchive

Parameters:
  • * lookup ( ID, Handle, Role,)

templates

Name Description I/O

Template lookup

Find specific template by ID or handle

Parameters:
  • * lookup ( ID, Handle, Template,)

Results:
  • template (Template)

Templates search

Parameters:
  • handle ( String,)

  • type ( String,)

  • ownerID ( ID,)

  • partial ( Boolean,)

  • labels ( KV,)

  • sort ( String,)

  • limit ( UnsignedInteger,)

  • incTotal ( Boolean,)

  • incPageNavigation ( Boolean,)

  • pageCursor ( String,)

Results:
  • templates (Template)

  • total (UnsignedInteger)

Template create

Parameters:
  • * template ( Template,)

Results:
  • template (Template)

Template update

Parameters:
  • * template ( Template,)

Results:
  • template (Template)

Template delete

Parameters:
  • * lookup ( ID, Handle, Template,)

Template recover

Parameters:
  • * lookup ( ID, Handle, Template,)

Template render

Parameters:
  • * lookup ( ID, Handle, Template,)

  • documentName ( String,)

  • documentType ( String,)

  • variables ( Vars,)

  • options ( RenderOptions,)

Results:
  • document (RenderedDocument)

users

Name Description I/O

User lookup

Find specific user by ID, handle or string

Parameters:
  • * lookup ( ID, Handle, String, User,)

Results:
  • user (User)

User role search

Search user role membership by ID, handle or string

Parameters:
  • * lookup ( ID, Handle, String, User,)

Results:
  • roles (Role)

  • total (UnsignedInteger)

User membership check

Find user role membership by ID, handle or string

Parameters:
  • * user ( ID, Handle, String, User,)

  • * role ( ID, Handle, Role,)

Results:
  • member (Boolean)

User search

Parameters:
  • query ( String,)

  • email ( String,)

  • handle ( String,)

  • labels ( KV,)

  • deleted ( UnsignedInteger,)

  • suspended ( UnsignedInteger,)

  • sort ( String,)

  • limit ( UnsignedInteger,)

  • incTotal ( Boolean,)

  • incPageNavigation ( Boolean,)

  • pageCursor ( String,)

Results:
  • users (User)

  • total (UnsignedInteger)

User create

Parameters:
  • * user ( User,)

Results:
  • user (User)

User update

Parameters:
  • * user ( User,)

Results:
  • user (User)

User delete

Parameters:
  • * lookup ( ID, Handle, String, User,)

User recover

Parameters:
  • * lookup ( ID, Handle, String, User,)

User suspend

Parameters:
  • * lookup ( ID, Handle, String, User,)

User unsuspend

Parameters:
  • * lookup ( ID, Handle, String, User,)

valuestore

Name Description I/O

Get ENV variable

Get ENV variable for the specified key. If the key doesn’t correspond to any value, nil is returned.

To avoid leaking sensitive information, this function only permits access to a pre-defined set of ENV variables. To extend the predefined list of ENV variables, any variable prefixed with CORTEZA_ENV is also accessible. These keys are case-insensitive. The prefix from custom ENV variables is preserved, meaning that CORTEZA_ENV_TEST remains CORTEZA_ENV_TEST.

List of predefined ENV variables:
  • NAME: Environment name.

  • IS-DEVELOPMENT: Denotes if the environment is set to dev. If you need more control, use NAME directly.

  • IS-TEST: Denotes if the environment is set to test. If you need more control, use NAME directly.

  • IS-PRODUCTION: Denotes if the environment is neither development or test. If you need more control, use NAME directly.`

  • VERSION: Denotes the Corteza version currently running.

  • BUILD-TIME: Denotes the build time of the currently running Corteza instance.

  • AUTH.BASE-URL: Denotes the base URL for the authentication service.

  • AUTH.DOMAIN: Denotes the domain for the authentication service.

  • API.BASE-URL: Denotes the base URL for the Corteza instance.

  • API.DOMAIN: Denotes the API domain for the Corteza instance.

  • WEBAPP.BASE-URL: Denotes the base URL for the web applications.

  • WEBAPP.DOMAIN: Denotes the domain for the web applications.

  • WEBAPP.BASE-URL.COMPOSE: Denotes the base URL for the COMPOSE web application if it’s enabled in the HTTP_WEBAPP_LIST ENV variable.

  • WEBAPP.BASE-URL.ADMIN: Denotes the base URL for the ADMIN web application if it’s enabled in the HTTP_WEBAPP_LIST ENV variable.

  • WEBAPP.BASE-URL.WORKFLOW: Denotes the base URL for the WORKFLOW web application if it’s enabled in the HTTP_WEBAPP_LIST ENV variable.

  • WEBAPP.BASE-URL.REPORTER: Denotes the base URL for the REPORTER web application if it’s enabled in the HTTP_WEBAPP_LIST ENV variable.

  • WEBAPP.BASE-URL.DISCOVERY: Denotes the base URL for the DISCOVERY web application if it’s enabled in the HTTP_WEBAPP_LIST ENV variable.

Parameters:
  • * key ( String,)

Results:
  • value (Any)