const response = await fetch('https://cloud-api.calyptia.com/v1/preview_processing_rule', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"language": "lua",
"actions": [
{
"kind": "add",
"description": "Sample action",
"enabled": true,
"selectors": [
{
"kind": "key",
"op": "equal",
"expr": "some_key"
}
]
}
],
"logs": [
[
"[1234.5, {\"key\": \"value\"}]"
]
]
}),
});
const data = await response.json();