backendless-console-sdk
Version:
Backendless Console SDK for Node.js and browser
321 lines (319 loc) • 17.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _routes = require("./utils/routes");
/* eslint-disable max-len */
var routes = (0, _routes.prepareRoutes)({
flows: '/api/app/:appId/automation/flow/version',
flowsWithElements: '/api/app/:appId/automation/flow/version/with-elements',
flowsWithElementsDetails: '/api/app/:appId/automation/flow/version/with-elements-details',
flowsElements: '/api/app/:appId/automation/flows/versions/elements',
flow: '/api/app/:appId/automation/flow/version/:versionId',
flowSchedule: '/api/app/:appId/automation/flow/version/:versionId/schedule',
newFlowVersion: '/api/app/:appId/automation/flow/version/:versionId/new-version',
flowState: '/api/app/:appId/automation/flow/version/:versionId/:state',
sharedMemory: '/api/app/:appId/automation/flow/version/:versionId/shared-memory',
flowGroupName: '/api/app/:appId/automation/flow/:flowId/name',
flowDescription: '/api/app/:appId/automation/flow/version/:versionId/description',
flowGroup: '/api/app/:appId/automation/flow/:flowId',
flowVersionAnalytics: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics',
flowVersionMetrics: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/version-metrics',
stepsMetrics: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/step-metrics',
flowInstances: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/instances/find',
countInstances: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/instances/count',
flowInstance: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/instances/:executionId',
elementExecutionInfo: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/instances/:executionId/element/:elementId',
flowSlA: '/api/app/:appId/automation/flow/:flowId/version/:versionId/sla/goals',
flowSlAGoal: '/api/app/:appId/automation/flow/:flowId/version/:versionId/sla/goals/:id',
SLACalendars: '/api/app/:appId/automation/flow/sla/calendar',
SLACalendar: '/api/app/:appId/automation/flow/sla/calendar/:id',
errorHandlerAnalytics: '/api/app/:appId/automation/flow/:flowId/version/:versionId/analytics/error-handler/:errorHandlerId/recorded-errors',
customElements: '/api/node-server/manage/app/:appId/flowrunner/custom-elements',
flowrunnerAiAgentsProviders: '/api/node-server/manage/flowrunner/ai-agents/providers',
startDebugSession: '/api/app/:appId/automation/flow/:flowId/version/:versionId/debug/test-monitor/start-session',
stopDebugSession: '/api/app/:appId/automation/flow/:flowId/version/:versionId/debug/test-monitor/stop-session',
testMonitorHistory: '/api/app/:appId/automation/flow/:flowId/version/:versionId/debug/test-monitor/history',
debugExecutionContext: '/api/app/:appId/automation/flow/:flowId/version/:versionId/debug/test-monitor/execution-context',
runElementInDebugMode: '/api/app/:appId/automation/flow/:flowId/version/:versionId/debug/run/element/:elementId',
allowedAIModels: '/api/app/:appId/automation/ai/assistants/allowed-models',
registerAIAssistant: '/api/app/:appId/automation/ai/assistants/register',
aiAssistants: '/api/app/:appId/automation/ai/assistants',
aiAssistant: '/api/app/:appId/automation/ai/assistants/:id',
flowLogs: '/api/app/:appId/automation/flow/version/:id/logs/find',
flowLogsLevel: '/api/app/:appId/automation/:flowId/logging/level',
exportFlowVersion: '/api/app/:appId/automation/flow/version/:id/export',
importFlowVersion: '/api/app/:appId/automation/flow/:flowId/import',
createFlowFromJSON: '/api/app/:appId/automation/flow/import',
realtimeTriggerCallbackUrl: '/api/app/:appId/automation/flow/version/trigger/realtime/callback-url',
startLearningMode: '/api/app/:appId/automation/flow/:flowId/version/:id/debug/element/:elementId/learning/start',
stopLearningMode: '/api/app/:appId/automation/flow/:flowId/version/:id/debug/element/:elementId/learning/stop',
getElementsResults: '/api/app/:appId/automation/flow/:flowId/version/:id/debug/element/results',
getElementsLearningResults: '/api/app/:appId/automation/flow/:flowId/version/:id/debug/element/learning/all-results',
getElementLearningResult: '/api/app/:appId/automation/flow/:flowId/version/:id/debug/element/:elementId/learning/result',
installFlowProduct: '/api/app/:appId/automation/flow/marketplace/install/:productId',
uninstallFlowProduct: '/api/app/:appId/automation/flow/marketplace/uninstall/:productId',
createSubFlow: '/api/app/:appId/automation/version/:versionId/subflow',
getSubFlowByID: '/api/app/:appId/automation/version/:versionId/subflow/:subFlowId',
updateSubFlowByID: '/api/app/:appId/automation/version/:versionId/subflow/:subFlowId',
deleteSubFlowByID: '/api/app/:appId/automation/version/:versionId/subflow/:subFlowId',
getSubFlows: '/api/app/:appId/automation/version/:versionId/subflow',
getSubFlowsWithElements: '/api/app/:appId/automation/version/:versionId/subflow/with-elements',
getSubFlowsWithElementsDetails: '/api/app/:appId/automation/version/:versionId/subflow/with-elements-details'
});
var _default = function _default(req) {
return {
getFlows: function getFlows(appId) {
return req.automation.get(routes.flows(appId));
},
getFlowsElements: function getFlowsElements(appId, elementType, elementSubtype) {
return req.automation.get(routes.flowsElements(appId)).query({
elementType: elementType,
elementSubtype: elementSubtype
});
},
getFlowsWithElements: function getFlowsWithElements(appId) {
return req.automation.get(routes.flowsWithElements(appId));
},
getFlowsWithElementsDetails: function getFlowsWithElementsDetails(appId) {
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
return req.automation.get(routes.flowsWithElementsDetails(appId)).query({
status: status
});
},
getFlow: function getFlow(appId, id) {
return req.automation.get(routes.flow(appId, id));
},
createFlow: function createFlow(appId, flow) {
return req.automation.post(routes.flows(appId), flow);
},
updateFlow: function updateFlow(appId, flow) {
return req.automation.put(routes.flow(appId, flow.id), flow);
},
deleteFlow: function deleteFlow(appId, id) {
return req.automation["delete"](routes.flow(appId, id));
},
enableFlow: function enableFlow(appId, id) {
return req.automation.post(routes.flowState(appId, id, 'enable'));
},
pauseFlow: function pauseFlow(appId, id) {
return req.automation.post(routes.flowState(appId, id, 'pause'));
},
terminateFlow: function terminateFlow(appId, id) {
return req.automation.post(routes.flowState(appId, id, 'terminate'));
},
createNewVersion: function createNewVersion(appId, id) {
return req.automation.post(routes.newFlowVersion(appId, id));
},
editFlowsGroupName: function editFlowsGroupName(appId, groupId, name) {
return req.automation.put(routes.flowGroupName(appId, groupId), {
name: name
});
},
deleteFlowsGroup: function deleteFlowsGroup(appId, groupId) {
return req.automation["delete"](routes.flowGroup(appId, groupId));
},
updateFlowDescription: function updateFlowDescription(appId, versionId, description) {
return req.put(routes.flowDescription(appId, versionId, description), {
description: description
});
},
getFlowVersionMetrics: function getFlowVersionMetrics(appId, flowId, versionId, fromDate, toDate) {
return req.automation.get(routes.flowVersionMetrics(appId, flowId, versionId)).query({
fromDate: fromDate,
toDate: toDate
});
},
getFlowStepsMetrics: function getFlowStepsMetrics(appId, flowId, versionId, fromDate, toDate) {
return req.automation.get(routes.stepsMetrics(appId, flowId, versionId)).query({
fromDate: fromDate,
toDate: toDate
});
},
getFlowInstances: function getFlowInstances(appId, flowId, versionId, body) {
return req.automation.post(routes.flowInstances(appId, flowId, versionId), body);
},
countFlowInstances: function countFlowInstances(appId, flowId, versionId, body) {
return req.automation.post(routes.countInstances(appId, flowId, versionId), body);
},
getFlowInstanceAnalytics: function getFlowInstanceAnalytics(appId, flowId, versionId, executionId) {
return req.automation.get(routes.flowInstance(appId, flowId, versionId, executionId));
},
cleanFlowVersionAnalytics: function cleanFlowVersionAnalytics(appId, flowId, versionId) {
return req.automation["delete"](routes.flowVersionAnalytics(appId, flowId, versionId));
},
getElementExecutionInfo: function getElementExecutionInfo(appId, flowId, versionId, executionId, elementId) {
return req.automation.get(routes.elementExecutionInfo(appId, flowId, versionId, executionId, elementId));
},
loadErrorHandlerAnalytics: function loadErrorHandlerAnalytics(appId, flowId, versionId, errorHandlerId, fromDate, toDate) {
return req.automation.get(routes.errorHandlerAnalytics(appId, flowId, versionId, errorHandlerId)).query({
fromDate: fromDate,
toDate: toDate
});
},
getCustomElements: function getCustomElements(appId) {
return req.automation.get(routes.customElements(appId));
},
getAiAgentsProviders: function getAiAgentsProviders() {
return req.nodeAPI.get(routes.flowrunnerAiAgentsProviders());
},
getRealtimeTriggerCallbackUrl: function getRealtimeTriggerCallbackUrl(appId, scope, hostType, serviceName, modelName, lang) {
return req.automation.get(routes.realtimeTriggerCallbackUrl(appId)).query({
scope: scope,
hostType: hostType,
serviceName: serviceName,
modelName: modelName,
lang: lang
});
},
startDebugSession: function startDebugSession(appId, flowId, versionId, forceStart) {
return req.automation.post(routes.startDebugSession(appId, flowId, versionId)).query({
forceStart: forceStart
});
},
stopDebugSession: function stopDebugSession(appId, flowId, versionId, sessionId) {
return req.automation["delete"](routes.stopDebugSession(appId, flowId, versionId)).query({
sessionId: sessionId
});
},
loadTestMonitorHistory: function loadTestMonitorHistory(appId, flowId, versionId, sessionId) {
return req.automation.get(routes.testMonitorHistory(appId, flowId, versionId)).query({
sessionId: sessionId
});
},
clearTestMonitorHistory: function clearTestMonitorHistory(appId, flowId, versionId, sessionId) {
return req.automation["delete"](routes.testMonitorHistory(appId, flowId, versionId)).query({
sessionId: sessionId
});
},
loadDebugExecutionContext: function loadDebugExecutionContext(appId, flowId, versionId, sessionId) {
return req.automation.get(routes.debugExecutionContext(appId, flowId, versionId)).query({
sessionId: sessionId
});
},
updateDebugExecutionContext: function updateDebugExecutionContext(appId, flowId, versionId, context, sessionId) {
return req.automation.put(routes.debugExecutionContext(appId, flowId, versionId), context).query({
sessionId: sessionId
});
},
runElementInDebugMode: function runElementInDebugMode(appId, flowId, versionId, elementId, body, sessionId) {
return req.automation.post(routes.runElementInDebugMode(appId, flowId, versionId, elementId), body, sessionId).query({
sessionId: sessionId
});
},
getFlowSLAGoals: function getFlowSLAGoals(appId, flowId, versionId) {
return req.automation.get(routes.flowSlA(appId, flowId, versionId));
},
createFlowSLAGoal: function createFlowSLAGoal(appId, flowId, versionId, data) {
return req.automation.post(routes.flowSlA(appId, flowId, versionId), data);
},
updateFlowSLAGoal: function updateFlowSLAGoal(appId, flowId, versionId, data, id) {
return req.automation.put(routes.flowSlAGoal(appId, flowId, versionId, id), data);
},
deleteFlowSLAGoal: function deleteFlowSLAGoal(appId, flowId, versionId, id) {
return req.automation["delete"](routes.flowSlAGoal(appId, flowId, versionId, id));
},
getSLACalendars: function getSLACalendars(appId) {
return req.automation.get(routes.SLACalendars(appId));
},
createSLACalendar: function createSLACalendar(appId, data) {
return req.automation.post(routes.SLACalendars(appId), data);
},
updateSLACalendar: function updateSLACalendar(appId, data, id) {
return req.automation.put(routes.SLACalendar(appId, id), data);
},
deleteSLACalendar: function deleteSLACalendar(appId, id) {
return req.automation["delete"](routes.SLACalendar(appId, id));
},
getAllowedAIModels: function getAllowedAIModels(appId) {
return req.automation.get(routes.allowedAIModels(appId));
},
registerAIAssistant: function registerAIAssistant(appId, openAiAssistantId) {
return req.automation.post(routes.registerAIAssistant(appId), {
openAiAssistantId: openAiAssistantId
});
},
createAIAssistant: function createAIAssistant(appId, assistant) {
return req.automation.post(routes.aiAssistants(appId), assistant);
},
updateAIAssistant: function updateAIAssistant(appId, assistant) {
return req.automation.put(routes.aiAssistant(appId, assistant.id), assistant);
},
deleteAIAssistant: function deleteAIAssistant(appId, assistantId) {
return req.automation["delete"](routes.aiAssistant(appId, assistantId));
},
getAIAssistants: function getAIAssistants(appId) {
return req.automation.get(routes.aiAssistants(appId));
},
loadFlowLogs: function loadFlowLogs(appId, versionId, data) {
return req.automation.post(routes.flowLogs(appId, versionId), data);
},
getFlowLogsLevel: function getFlowLogsLevel(appId, flowId) {
return req.automation.get(routes.flowLogsLevel(appId, flowId));
},
updateFlowLogsLevel: function updateFlowLogsLevel(appId, flowId, data) {
return req.automation.put(routes.flowLogsLevel(appId, flowId), data);
},
exportFlowVersion: function exportFlowVersion(appId, versionId) {
return req.automation.get(routes.exportFlowVersion(appId, versionId));
},
importFlowVersion: function importFlowVersion(appId, versionId, flow) {
return req.automation.post(routes.importFlowVersion(appId, versionId), flow);
},
createFlowFromJSON: function createFlowFromJSON(appId, flow) {
return req.automation.post(routes.createFlowFromJSON(appId), flow);
},
updateFlowSchedule: function updateFlowSchedule(appId, versionId, data) {
return req.automation.put(routes.flowSchedule(appId, versionId), data);
},
startLearningMode: function startLearningMode(appId, flowId, versionId, elementId) {
return req.automation.post(routes.startLearningMode(appId, flowId, versionId, elementId));
},
stopLearningMode: function stopLearningMode(appId, flowId, versionId, elementId) {
return req.automation.post(routes.stopLearningMode(appId, flowId, versionId, elementId));
},
getElementsResults: function getElementsResults(appId, flowId, versionId) {
return req.automation.get(routes.getElementsResults(appId, flowId, versionId));
},
getElementsLearningResults: function getElementsLearningResults(appId, flowId, versionId) {
return req.automation.get(routes.getElementsLearningResults(appId, flowId, versionId));
},
getElementLearningResult: function getElementLearningResult(appId, flowId, versionId, elementId) {
return req.automation.get(routes.getElementLearningResult(appId, flowId, versionId, elementId));
},
installFlowFromMarketplace: function installFlowFromMarketplace(appId, productId, version, data) {
return req.automation.post(routes.installFlowProduct(appId, productId), data).query({
version: version
});
},
uninstallFlowProduct: function uninstallFlowProduct(appId, productId, data) {
return req.automation["delete"](routes.uninstallFlowProduct(appId, productId), data);
},
updateSharedMemorySettings: function updateSharedMemorySettings(appId, versionId, data) {
return req.automation.put(routes.sharedMemory(appId, versionId), data);
},
createSubFlow: function createSubFlow(appId, versionId, data) {
return req.automation.post(routes.createSubFlow(appId, versionId), data);
},
getSubFlow: function getSubFlow(appId, versionId, subFlowVersionId) {
return req.automation.get(routes.getSubFlowByID(appId, versionId, subFlowVersionId));
},
updateSubFlow: function updateSubFlow(appId, versionId, subFlowVersionId, data) {
return req.automation.put(routes.updateSubFlowByID(appId, versionId, subFlowVersionId), data);
},
deleteSubFlow: function deleteSubFlow(appId, versionId, subFlowId) {
return req.automation["delete"](routes.deleteSubFlowByID(appId, versionId, subFlowId));
},
getSubFlows: function getSubFlows(appId, versionId) {
return req.automation.get(routes.getSubFlows(appId, versionId));
},
getSubFlowsWithElements: function getSubFlowsWithElements(appId, versionId) {
return req.automation.get(routes.getSubFlowsWithElements(appId, versionId));
},
getSubFlowsWithElementsDetails: function getSubFlowsWithElementsDetails(appId, versionId) {
return req.automation.get(routes.getSubFlowsWithElementsDetails(appId, versionId));
}
};
};
exports["default"] = _default;