<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Scripting on</title><link>https://platform-docs.slingr.io/dev-reference/scripting/</link><description>Recent content in Scripting on</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 16 Nov 2020 13:59:39 +0100</lastBuildDate><atom:link href="https://platform-docs.slingr.io/dev-reference/scripting/index.xml" rel="self" type="application/rss+xml"/><item><title>Overview</title><link>https://platform-docs.slingr.io/dev-reference/scripting/overview/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/overview/</guid><description>Javascript API Overview # Scripts provide a highly flexible means of extending and customizing your apps. While a declarative approach is often preferred, we recognize that in certain situations, it may not be feasible to cover all scenarios. Sometimes, writing a few lines of code is more straightforward than navigating a complex and time-consuming user interface to express certain functionalities in a declarative manner.
The primary objective is for you to write scripts solely to define your application&amp;rsquo;s behavior.</description></item><item><title>Namespaces</title><link>https://platform-docs.slingr.io/dev-reference/scripting/namespaces/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/namespaces/</guid><description>Overview # The JavaScript API enables access to various components of your application through scripts. For instance, you can conduct queries, manipulate data, execute actions, or assess the status of background jobs.
The API is structured into packages, each catering to distinct functions such as data manipulation, user management, or background job monitoring.
Subsequent sections delve into comprehensive information about each segment of the JavaScript API.
Namespaces # App Common classes Context Data Legacy Services Events Exceptions Files Internationalization Jobs Logs Storage UI Users Utils Monitoring</description></item><item><title>sys.ai</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-ai/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-ai/</guid><description>sys.ai # This package encompasses methods for making us of ai features in your application.
embeddingsBatchProcessing(inputs,callback) # This will trigger a background job to embed a list of inputs. It will trigger a batch embedding generation on Vertex AI API and then it will execute a callback on the outputs.
See Google’s batch embeddings inputs and outputs. Context can be passed in inputs and used when executing the callback.
Parameters # Name Type Required Description inputs objects yes An array of JSON objects that will be used to generate embeddings.</description></item><item><title>sys.app</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-app/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-app/</guid><description>sys.app # This package encompasses methods for retrieving information about the app, such as its name, URL, current environment, and more.
getLabel() # Returns the label of the app currently in execution.
Returns # string - The label of the app.
Samples # // logs the label of the app log('app: '+sys.app.getLabel()); getName() # Returns the name of the app currently in execution.
Returns # string - The name of the app.</description></item><item><title>sys.auth</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys.auth/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys.auth/</guid><description>sys.auth # This package contains some utilities to work with authentication of the API REST.
sendOtpCode(options) # Request an OTP code for a specific email or phone with the permission of the current user.
Parameters # Name Type Required Description options object yes These options allow you to configure the validity of the code and token to be generated and the destination to which it will be sent. Available option is:</description></item><item><title>sys.cache</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-cache/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-cache/</guid><description>sys.cache # This package contains methods to handle app cache across all app instances. Cache is useful when fast performance is needed when reading app information. This should be carefully used since app heap memory can be affected when a lot of information is stored in cache.
&amp;#x26A0;&amp;#xFE0F; Data is cached locally in each instance of the application. So be aware that if you are updating cached data, you will need to call sys.</description></item><item><title>sys.commons</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-commons/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-commons/</guid><description>sys.commons.ResultSet # ResultSet is an iterator designed for traversing API service call results. The ResultSet object retains a cursor that indicates the current object it&amp;rsquo;s pointing to. Initially, the cursor is positioned before the first object. The next() method advances the cursor to the next available object.
The cursor can only move forward.
hasNext() # Checks whether there are more objects.
Returns # boolean - true if there are more objects, false otherwise.</description></item><item><title>sys.context</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-context/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-context/</guid><description>sys.context # This package provides methods to retrieve information about the execution context of the script, such as the current user or the call stack.
getCurrentUserRecord() # Returns a sys.data.Record object containing the current user in the ongoing execution context. If there is no user defined in the current execution context, this method will return null.
Returns # sys.data.record - The user in the current execution context, or null if not set.</description></item><item><title>sys.data</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-data/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-data/</guid><description>sys.data # This package contains methods and classes for working with data in your application. You&amp;rsquo;ll find utilities for querying data, creating, updating, or deleting records, as well as more advanced operations like aggregation and executing actions.
findById(entityName, id) # This function finds a record by its ID. If the record is not found, null will be returned.
Parameters # Name Type Required Description entityName string yes The name of the entity id string yes ID of the record to find Returns # sys.</description></item><item><title>sys.dataCache</title><link>https://platform-docs.slingr.io/dev-reference/scripting/sys-datacache/</link><pubDate>Mon, 16 Nov 2020 13:59:39 +0100</pubDate><guid>https://platform-docs.slingr.io/dev-reference/scripting/sys-datacache/</guid><description>sys.dataCache # This package contains methods to handle app cache optimized for handling application data. Cache is useful when fast performance is needed when reading app information. This should be carefully used since app heap memory can be affected when a lot of information is stored in cache. Records can be stored as records format or a json object in the cache.
&amp;#x26A0;&amp;#xFE0F; Records cached locally in each instance of the application.</description></item></channel></rss>