Readonly
CssThe [[CssClasses]].
Readonly
OptionalTODO
Readonly
UUIDReturns a UUID/GUID object. These are system generated universally unique identifiers.
Readonly
canonicalB.util.canonicalServerName
will tell you the fully qualified name of server this script is currently executing on.
Readonly
currentB.util.currentServer
will tell you what server this script is currently executing on.
Readonly
hostB.util.hostAndNamespace
will tell you the host.namespace of server this script is currently executing on.
Readonly
namespaceB.util.namespace
will tell you the fully qualified name of server this script is currently executing on.
Readonly
staticReturns the static prefix to access static content.
Using this prefix will allow the content to be served cached by the browser.
This is equivalent \
/static/${B.util.version}`` right now. However this
may change in the future to a CDN.
Readonly
versionReturns Bluesteps running version
Manually removes a key from the cache. This is useful when you need a query removed from the cache before a commit.
Convenience method. It just calls B.util.cacheRemove(B.util.toId(id)).
Create an [[Alert]]. For details see [[AlertBuilder]]. The fields: type, message, and endDate are required.
Optional
settings: AlertSettingsSettings object contain field necessary to create the Alert. If parameter is not specified a builder is returned.
Create an alert using a settings object.
const alert = B.createAlert({
type: 'auto',
message: 'Hello World',
endDate: B.time.Instant.now()
});
Create an alert using a builder.
const alert = B.createAlert()
.type('signature')
.message('Hello World')
.endDate(B.time.Instant.now())
.create();
Creates an [[Email]] object to send an email.
Optional
settings: EmailSettingsB.email({
to: 'user@email.host',
subject: 'test',
text: 'Hello World'
}).send();
B.email()
.to('user@email.host')
.subject('test')
.text('Hello World')
.send();
Creates a new java BigDecimal object from the given value.
const bigDecimal = B.util.newBigDecimal("123.45");
Creates a new java BigInteger object from the given value.
const bigInteger = B.util.newBigInteger("123456789012345678901234567890");
Returns a new Calendar object with the current time.
Optional
instant: InstantOrDateCreates an [[Shlink]] object to generate a short link.
Optional
settings: ShlinkSettingsDelays the continued execution of this thread for the specified number of milliseconds. While this method certainly has its uses, it is generally not recommended for use in most scripts; since it is easy to be tempted to use it to "bandaid" design flaws.
console.log("I'm executed now");
B.delay(10000);
console.log("I'm executed ten seconds later");
Creates an [[TextMessage]] object to send an Text.
Optional
settings: TextSettingsconst ptoDate = pto.fields.date.val();
const mPhone = contactInfo.fields.phone.val();
B.util.text({
message: 'Your PTO ${ptoDate} was approved',
to: mPhone,
unit: pto.formRecord().record().unit().id().longId(),
id: contactInfo.id().toString()
}).send();
Convert the name and value and the class type to an [[AltId]]
The AltId's name.
The AltId's value.
Value representing the class type of AltId
const altid = B.toAltId('animal', 'dog', 222222);
const altid = B.toAltId('animal', 'dog', 'myassn.user.User');
If a short id is passed it uses the classIfIdIsShortId to identify its class. Otherwise what ever class stored in the id is used.
Value representing an full or short id.
const id = B.toAnyId('5', 222222);
const id = B.toAnyId('5', 'myassn.user.User');
Convert a full or short id and its class type to an [[Id]]
Value representing an full or short id.
Optional
classType: string | numberRequired when id represents a short id.
const id = B.toId('222222___5');
const id = B.toId('5', 222222);
const id = B.toId('5', 'myassn.user.User');
Convert a full or short id and its class type to an Id object, or null if it doesn't exist.
string representing a full id.
const id = B.toIdOrNull('222222___5');
Generated using TypeDoc
TODO
Example