📄️ Introduction
LOC SDK is a downloadable NPM package that defines the interfaces of data context as well as agents - a series of features provided by LOC's logic runtime that can read and/or write internal and external storages.
📄️ Context and Task
Data Context is an object injected into logic functions at runtime, which containes some key components:
📄️ Payload
Payload is the data and metadata of a trigger as initial input and is accessible from the context object. Currently there are several payload types:
📄️ Session Storage Agent
For sharing data between logic during a task (execution) of a data process.
📄️ Local Storage Agent
For sharing data between tasks of one data process, which can stay persistent for a period of time.
📄️ Event Store Agent
Emit and query LOC data events.
📄️ Result Agent
Finalise a JSON object as the task result data. If the trigger is synchronized API route or message queue, it will be returned to the trigger, otherwise stored in LOC to be retrieved later.
📄️ Logging Agent
Log (debugging) messages to LOC.
📄️ Logic Variable Agent
Read a local environment variable (not to be confused with local storage data or secrets in agent configurations). These variable can be set via Studio or CLI, which are useful for configuring a data process' behavior without modifying the logic code.
📄️ HTTP Agent
For sending HTTP requests to specific hosts.
📄️ Database Agent
Connecting external databases with built-in drivers. Currently the following databases are supported:
📄️ File Storage Agent
Accessing and writing files. Supports the following storages:
📄️ Mail Agent
Sending emails with a SMTP server.