Utility

Functions to encode and decode or convert from a format to another one

create meeting(start, end, to, from, subject, [body], [location], [responses])

Create a .ics file containing a meeting invite

Parameters
Name Required Type Description

start

Yes

Date and time

Start date and time

end

Yes

Date and time

End date and time

to

Yes

Collection of Text

Other attendees' email address

from

Yes

Text

Meeting organiser email address

subject

Yes

Text

Title of the meeting

body

No

Text

Description of the meeting

location

No

Text

Meeting’s location

responses

No

Boolean

True to recieve responses from the attendees by email. Default : false

Returns

File

decode Base64(string, [encoding])

Base64 decode (both classic and URL encoding flavors) considering an optional character set encoding (defaults to UTF-8)

Parameters
Name Required Type Description

string

Yes

Text

Base64 encoded data

encoding

No

Text

Encoding Character Set ('UTF-8', 'ISO_8859_1', …​)

Returns

Text

Examples
utility.decode Base64("aGVsbG8=") => "hello"

decode JSON(string)

JSON decode function. Convert string to object

Parameters
Name Required Type Description

string

Yes

Text

Data as string

Returns

Any

Examples
utility.decode JSON("{\"name\":\"John\"}") => "{\"name\":\"John\"}"

encode Base64(data, [encoding])

Encode the data parameter using the Base64 encoding and the optional character encoding (defaults to UTF-8)

Parameters
Name Required Type Description

data

Yes

Text

Object

encoding

No

Text

Encoding Character Set ('UTF-8', 'ISO_8859_1', …​)

Returns

Text

Examples
utility.encode Base64("hello") => "aGVsbG8="

encode Base64URL(data, [encoding])

Encode the data parameter using the Base64 URL encoding and the optional character encoding (defaults to UTF-8)

Parameters
Name Required Type Description

data

Yes

Text

Object

encoding

No

Text

Encoding Character Set ('UTF-8', 'ISO_8859_1', …​)

Returns

Text

Examples
utility.encode Base64URL("hello") => "aGVsbG8="

encode JSON(data)

JSON encode function. Convert Object/JSON to string

Parameters
Name Required Type Description

data

Yes

Any

String

Returns

Text

Examples
utility.encode JSON({"name":"John"}) => "\"{\"name\":\"John\"}\""

filter null values(obj)

Remove null values from collections and context entries with null values recursively. Supports Any input type.

Parameters
Name Required Type Description

obj

Yes

Any

remove nulls from this

Returns

Any

Examples
utility.filter null values("{\"name\":\"John\", \"value\": null}") => "{\"name\":\"John\"}"

utility.filter null values([1, null, 2]) => "[1, 2]"

from epoch(timestamp)

Epoch function convert timestamp to date and time, timestamp is expressed in milliseconds and date and time is set to UTC

Parameters
Name Required Type Description

timestamp

Yes

Number

Timestamp expressed in milliseconds

Returns

Date and time

Examples
utility.from epoch(1511567100000) => "2017-11-24T23:45:00+00:00"

parse HTML(html)

Parse the HTML content and extract only the textual portion of the document.

Parameters
Name Required Type Description

html

Yes

Text

HTML document in string format

Returns

Text

to epoch(dateTime)

Epoch function convert date and time to timestamp, timestamp is expressed in milliseconds. If date and time is not localized, it will be set to UTC

Parameters
Name Required Type Description

dateTime

Yes

Date and time

Date and time

Returns

Number

Examples
utility.to epoch(date and time(2017-11-24, 23:45:00)) => "1511567100000"

uri(scheme, host, [path], [parameters], [fragment])

Returns a properly encoded URI based on the passed scheme, host, path, parameters and fragment

Parameters
Name Required Type Description

scheme

Yes

Text

Refers to a specification for assigning identifiers

host

Yes

Text

Address of the server

path

No

Text | Collection of Text

Path to the resource

parameters

No

Any

Context

fragment

No

Text

Fragment

Returns

Text

Examples
utility.uri("https", "www.trisotech.com") => "https://www.trisotech.com"

utility.uri("https", "www.trisotech.com", "/path", {k: "value"}, "frag") => "https://www.trisotech.com/path?k=value#frag"

utility.uri("https", "www.trisotech.com", ["path1", "path2"]) => "https://www.trisotech.com/path1/path2"

validate XSD(XSD, XML)

XSD validation of XML content against an XSD schema. Returns a collection of errors to indicate if errors were collected while validating content.

Parameters
Name Required Type Description

XSD

Yes

Text

XSD schema against which content will be validated

XML

Yes

Text

XML content which will be validated against XSD schema

Returns

Collection of Text