@transai/connector-runner-dummy-node 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/index.cjs +1 -1
- package/index.cjs.map +2 -2
- package/index.js +1 -1
- package/index.js.map +2 -2
- package/libs/connector-runtime-sdk/src/lib/sdk/receiver.sdk.interface.d.ts +1 -1
- package/libs/types/src/lib/management-api/workflow/workflow-run.d.ts +1 -5
- package/libs/types/src/lib/management-api/workflow/workflow.drawing.d.ts +1 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var d=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var I=(
|
|
1
|
+
"use strict";var d=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var I=(t,o)=>{for(var e in o)c(t,e,{get:o[e],enumerable:!0})},l=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of C(o))!u.call(t,n)&&n!==e&&c(t,n,{get:()=>o[n],enumerable:!(r=g(o,n))||r.enumerable});return t};var h=(t,o,e)=>(e=t!=null?d(b(t)):{},l(o||!t||!t.__esModule?c(e,"default",{value:t,enumerable:!0}):e,t)),y=t=>l(c({},"__esModule",{value:!0}),t);var v={};I(v,{ConnectorRunnerDummyNode:()=>f});module.exports=y(v);var s=h(require("node:process")),a=class{constructor(o,e){this.#o="connector-runtime";this.init=()=>Promise.resolve();this.start=()=>Promise.resolve();this.stop=()=>Promise.resolve();this.#e=e,s.on?s.on("message",r=>{r.cmd===this.#o&&e.logger.verbose(`${s.pid} Received message from parent process:`,r)}):e.logger.warn("IPC channel is not available. process.on is undefined."),s.send||e.logger.warn("IPC channel is not available. process.send is undefined."),o.actions?.forEach(r=>{if(r.config.templates===void 0)return;let n={};Object.entries(r.config.templates).forEach(([i,p])=>{try{n[i]=e.templating.compile(p)}catch(m){e.logger.error(`Error compiling template ${i} for action ${r.identifier}`,m)}}),r.config.parsedTemplates=n})}#o;#e;set callbackFunction(o){this.connectorSDK.receiver.registerCallback(this.#r(o))}get connectorSDK(){return this.#e}#r(o){return async e=>{let r=await this.#e.receiver.getActionConfig(e);return r?o(e,r):this.#e.receiver.responses.badRequest("Action not found")(e)}}};var f=class extends a{constructor(){super(...arguments);this.CONNECTOR_INSTANCE="XOD_CONNECTOR_DUMMY_NODE_CONFIG";this.init=async()=>{let{config:e}=this.connectorSDK,r=e.failProbability||0;r>0&&this.connectorSDK.logger.debug("Fail probability set to",r);let n=()=>Math.random()<r;this.callbackFunction=async(i,p)=>(this.connectorSDK.logger.info("Received message: ",i.testRun?"(test run)":"",i.eventId,i.payload),n()?(this.connectorSDK.logger.error("Dummy process failed"),this.connectorSDK.receiver.responses.internalServerError("Dummy process failed")(i)):this.connectorSDK.receiver.responses.ok()(i))}}};0&&(module.exports={ConnectorRunnerDummyNode});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../libs/connector-runner-dummy-node/src/index.ts", "../../../libs/connector-runtime-sdk/src/lib/connector-runtime.ts", "../../../libs/connector-runner-dummy-node/src/lib/connector-runner-dummy-node.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './lib/connector-runner-dummy-node';\n", "import * as process from 'node:process';\n\nimport {\n KafkaCallbackResponse,\n BaseConnectorConfig,\n ActionInterface,\n ConnectorInterface,\n XodJobType,\n} from '@xip-online-data/types';\n\nimport { ConnectorRuntimeInterface } from './connector-runtime.interface';\nimport { CompileDelegate, ConnectorSDKInterface } from './sdk';\n\nexport interface IpcMessage {\n cmd: string;\n message: string;\n}\n\nexport abstract class ConnectorRuntimeSDK<\n T extends BaseConnectorConfig = BaseConnectorConfig,\n> implements ConnectorRuntimeInterface
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAAyB,2BAkBHC,EAAf,
|
|
4
|
+
"sourcesContent": ["export * from './lib/connector-runner-dummy-node';\n", "import * as process from 'node:process';\n\nimport {\n KafkaCallbackResponse,\n BaseConnectorConfig,\n ActionInterface,\n ConnectorInterface,\n XodJobType,\n} from '@xip-online-data/types';\n\nimport { ConnectorRuntimeInterface } from './connector-runtime.interface';\nimport { CompileDelegate, ConnectorSDKInterface } from './sdk';\n\nexport interface IpcMessage {\n cmd: string;\n message: string;\n}\n\nexport abstract class ConnectorRuntimeSDK<\n T extends BaseConnectorConfig = BaseConnectorConfig,\n> implements ConnectorRuntimeInterface {\n readonly #IPC_CHANNEL = 'connector-runtime';\n\n readonly #connectorSDK: ConnectorSDKInterface<T>;\n\n constructor(\n connector: ConnectorInterface,\n connectorSDK: ConnectorSDKInterface,\n ) {\n this.#connectorSDK = connectorSDK as ConnectorSDKInterface<T>;\n\n if (process.on) {\n process.on('message', (message: IpcMessage) => {\n if (message.cmd === this.#IPC_CHANNEL) {\n connectorSDK.logger.verbose(\n `${process.pid} Received message from parent process:`,\n message,\n );\n }\n });\n } else {\n connectorSDK.logger.warn(\n 'IPC channel is not available. process.on is undefined.',\n );\n }\n\n if (!process.send) {\n // Check if process.send is available\n connectorSDK.logger.warn(\n 'IPC channel is not available. process.send is undefined.',\n );\n }\n\n // eslint-disable-next-line no-restricted-syntax\n connector.actions?.forEach((action: ActionInterface) => {\n if (action.config['templates'] === undefined) {\n return;\n }\n\n const containers: {\n [key: string]: CompileDelegate;\n } = {};\n\n Object.entries(action.config['templates']).forEach(([key, value]) => {\n try {\n // eslint-disable-next-line security/detect-object-injection\n containers[key] = connectorSDK.templating.compile(value);\n } catch (error: unknown) {\n connectorSDK.logger.error(\n `Error compiling template ${key} for action ${action.identifier}`,\n error,\n );\n }\n });\n\n // eslint-disable-next-line no-param-reassign\n action.config['parsedTemplates'] = containers;\n });\n }\n\n public init: () => Promise<void> = () => Promise.resolve();\n\n public start: () => Promise<void> = () => Promise.resolve();\n\n public stop: () => Promise<void> = () => Promise.resolve();\n\n set callbackFunction(\n callback: (\n message: XodJobType,\n action: ActionInterface,\n ) => Promise<KafkaCallbackResponse>,\n ) {\n this.connectorSDK.receiver.registerCallback(\n this.#enrichWithActionConfig(callback),\n );\n }\n\n protected get connectorSDK(): ConnectorSDKInterface<T> {\n return this.#connectorSDK;\n }\n\n #enrichWithActionConfig(\n callbackFunction: (\n message: XodJobType,\n action: ActionInterface,\n ) => Promise<KafkaCallbackResponse>,\n ): (message: XodJobType) => Promise<KafkaCallbackResponse> {\n return async (message: XodJobType) => {\n const action = await this.#connectorSDK.receiver.getActionConfig(message);\n if (!action) {\n return this.#connectorSDK.receiver.responses.badRequest(\n 'Action not found',\n )(message);\n }\n return callbackFunction(message, action);\n };\n }\n}\n", "import { ConnectorRuntimeSDK } from '@transai/connector-runtime-sdk';\nimport {\n ActionInterface,\n BaseConnectorConfig,\n KafkaCallbackResponse,\n XodJobType,\n} from '@xip-online-data/types';\n\nexport class ConnectorRunnerDummyNode extends ConnectorRuntimeSDK<\n {\n failProbability?: number;\n } & BaseConnectorConfig\n> {\n readonly CONNECTOR_INSTANCE: string = 'XOD_CONNECTOR_DUMMY_NODE_CONFIG';\n\n override init = async (): Promise<void> => {\n const { config } = this.connectorSDK;\n\n const failProbability = config.failProbability || 0.0;\n if (failProbability > 0) {\n this.connectorSDK.logger.debug(\n 'Fail probability set to',\n failProbability,\n );\n }\n\n const dummyProcessFailed = (): boolean => {\n return Math.random() < failProbability;\n };\n\n this.callbackFunction = async (\n message: XodJobType,\n action: ActionInterface,\n ): Promise<KafkaCallbackResponse> => {\n this.connectorSDK.logger.info(\n 'Received message: ',\n message.testRun ? '(test run)' : '',\n message.eventId,\n message.payload,\n );\n\n if (dummyProcessFailed()) {\n this.connectorSDK.logger.error('Dummy process failed');\n return this.connectorSDK.receiver.responses.internalServerError(\n 'Dummy process failed',\n )(message);\n }\n\n return this.connectorSDK.receiver.responses.ok()(message);\n };\n };\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAAyB,2BAkBHC,EAAf,KAEgC,CAKrC,YACEC,EACAC,EACA,CAPF,KAASC,GAAe,oBA2DxB,KAAO,KAA4B,IAAM,QAAQ,QAAQ,EAEzD,KAAO,MAA6B,IAAM,QAAQ,QAAQ,EAE1D,KAAO,KAA4B,IAAM,QAAQ,QAAQ,EAvDvD,KAAKC,GAAgBF,EAET,KACF,KAAG,UAAYG,GAAwB,CACzCA,EAAQ,MAAQ,KAAKF,IACvBD,EAAa,OAAO,QAClB,GAAW,KAAG,yCACdG,CACF,CAEJ,CAAC,EAEDH,EAAa,OAAO,KAClB,wDACF,EAGW,QAEXA,EAAa,OAAO,KAClB,0DACF,EAIFD,EAAU,SAAS,QAASK,GAA4B,CACtD,GAAIA,EAAO,OAAO,YAAiB,OACjC,OAGF,IAAMC,EAEF,CAAC,EAEL,OAAO,QAAQD,EAAO,OAAO,SAAY,EAAE,QAAQ,CAAC,CAACE,EAAKC,CAAK,IAAM,CACnE,GAAI,CAEFF,EAAWC,CAAG,EAAIN,EAAa,WAAW,QAAQO,CAAK,CACzD,OAASC,EAAgB,CACvBR,EAAa,OAAO,MAClB,4BAA4BM,CAAG,eAAeF,EAAO,UAAU,GAC/DI,CACF,CACF,CACF,CAAC,EAGDJ,EAAO,OAAO,gBAAqBC,CACrC,CAAC,CACH,CAzDSJ,GAEAC,GA+DT,IAAI,iBACFO,EAIA,CACA,KAAK,aAAa,SAAS,iBACzB,KAAKC,GAAwBD,CAAQ,CACvC,CACF,CAEA,IAAc,cAAyC,CACrD,OAAO,KAAKP,EACd,CAEAQ,GACEC,EAIyD,CACzD,MAAO,OAAOR,GAAwB,CACpC,IAAMC,EAAS,MAAM,KAAKF,GAAc,SAAS,gBAAgBC,CAAO,EACxE,OAAKC,EAKEO,EAAiBR,EAASC,CAAM,EAJ9B,KAAKF,GAAc,SAAS,UAAU,WAC3C,kBACF,EAAEC,CAAO,CAGb,CACF,CACF,EC7GO,IAAMS,EAAN,cAAuCC,CAI5C,CAJK,kCAKL,KAAS,mBAA6B,kCAEtC,KAAS,KAAO,SAA2B,CACzC,GAAM,CAAE,OAAAC,CAAO,EAAI,KAAK,aAElBC,EAAkBD,EAAO,iBAAmB,EAC9CC,EAAkB,GACpB,KAAK,aAAa,OAAO,MACvB,0BACAA,CACF,EAGF,IAAMC,EAAqB,IAClB,KAAK,OAAO,EAAID,EAGzB,KAAK,iBAAmB,MACtBE,EACAC,KAEA,KAAK,aAAa,OAAO,KACvB,qBACAD,EAAQ,QAAU,aAAe,GACjCA,EAAQ,QACRA,EAAQ,OACV,EAEID,EAAmB,GACrB,KAAK,aAAa,OAAO,MAAM,sBAAsB,EAC9C,KAAK,aAAa,SAAS,UAAU,oBAC1C,sBACF,EAAEC,CAAO,GAGJ,KAAK,aAAa,SAAS,UAAU,GAAG,EAAEA,CAAO,EAE5D,EACF",
|
|
6
6
|
"names": ["index_exports", "__export", "ConnectorRunnerDummyNode", "__toCommonJS", "process", "ConnectorRuntimeSDK", "connector", "connectorSDK", "#IPC_CHANNEL", "#connectorSDK", "message", "action", "containers", "key", "value", "error", "callback", "#enrichWithActionConfig", "callbackFunction", "ConnectorRunnerDummyNode", "ConnectorRuntimeSDK", "config", "failProbability", "dummyProcessFailed", "message", "action"]
|
|
7
7
|
}
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as t from"node:process";var s=class{constructor(n,o){this.#o="connector-runtime";this.init=()=>Promise.resolve();this.start=()=>Promise.resolve();this.stop=()=>Promise.resolve();this.#e=o,t.on?t.on("message",e=>{e.cmd===this.#o&&o.logger.verbose(`${t.pid} Received message from parent process:`,e)}):o.logger.warn("IPC channel is not available. process.on is undefined."),t.send||o.logger.warn("IPC channel is not available. process.send is undefined."),n.actions?.forEach(e=>{if(e.config.templates===void 0)return;let i={};Object.entries(e.config.templates).forEach(([r,c])=>{try{i[r]=o.templating.compile(c)}catch(p){o.logger.error(`Error compiling template ${r} for action ${e.identifier}`,p)}}),e.config.parsedTemplates=i})}#o;#e;set callbackFunction(n){this.connectorSDK.receiver.registerCallback(this.#r(n))}get connectorSDK(){return this.#e}#r(n){return async o=>{let e=await this.#e.receiver.getActionConfig(o);return e?n(o,e):this.#e.receiver.responses.badRequest("Action not found")(o)}}};var a=class extends s{constructor(){super(...arguments);this.CONNECTOR_INSTANCE="XOD_CONNECTOR_DUMMY_NODE_CONFIG";this.init=async()=>{let{config:o}=this.connectorSDK,e=o.failProbability||0;e>0&&this.connectorSDK.logger.debug("Fail probability set to",e);let i=()=>Math.random()<e;this.callbackFunction=async(r,c)=>(this.connectorSDK.logger.info("Received message: ",r.testRun?"(test run)":"",r.eventId,r.payload),i()?(this.connectorSDK.logger.error("Dummy process failed"),this.connectorSDK.receiver.responses.internalServerError("Dummy process failed")(r)):this.connectorSDK.receiver.responses.ok()(r))}}};export{a as ConnectorRunnerDummyNode};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../libs/connector-runtime-sdk/src/lib/connector-runtime.ts", "../../../libs/connector-runner-dummy-node/src/lib/connector-runner-dummy-node.ts"],
|
|
4
|
-
"sourcesContent": ["import * as process from 'node:process';\n\nimport {\n KafkaCallbackResponse,\n BaseConnectorConfig,\n ActionInterface,\n ConnectorInterface,\n XodJobType,\n} from '@xip-online-data/types';\n\nimport { ConnectorRuntimeInterface } from './connector-runtime.interface';\nimport { CompileDelegate, ConnectorSDKInterface } from './sdk';\n\nexport interface IpcMessage {\n cmd: string;\n message: string;\n}\n\nexport abstract class ConnectorRuntimeSDK<\n T extends BaseConnectorConfig = BaseConnectorConfig,\n> implements ConnectorRuntimeInterface
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAa,eAkBlB,IAAeC,EAAf,
|
|
4
|
+
"sourcesContent": ["import * as process from 'node:process';\n\nimport {\n KafkaCallbackResponse,\n BaseConnectorConfig,\n ActionInterface,\n ConnectorInterface,\n XodJobType,\n} from '@xip-online-data/types';\n\nimport { ConnectorRuntimeInterface } from './connector-runtime.interface';\nimport { CompileDelegate, ConnectorSDKInterface } from './sdk';\n\nexport interface IpcMessage {\n cmd: string;\n message: string;\n}\n\nexport abstract class ConnectorRuntimeSDK<\n T extends BaseConnectorConfig = BaseConnectorConfig,\n> implements ConnectorRuntimeInterface {\n readonly #IPC_CHANNEL = 'connector-runtime';\n\n readonly #connectorSDK: ConnectorSDKInterface<T>;\n\n constructor(\n connector: ConnectorInterface,\n connectorSDK: ConnectorSDKInterface,\n ) {\n this.#connectorSDK = connectorSDK as ConnectorSDKInterface<T>;\n\n if (process.on) {\n process.on('message', (message: IpcMessage) => {\n if (message.cmd === this.#IPC_CHANNEL) {\n connectorSDK.logger.verbose(\n `${process.pid} Received message from parent process:`,\n message,\n );\n }\n });\n } else {\n connectorSDK.logger.warn(\n 'IPC channel is not available. process.on is undefined.',\n );\n }\n\n if (!process.send) {\n // Check if process.send is available\n connectorSDK.logger.warn(\n 'IPC channel is not available. process.send is undefined.',\n );\n }\n\n // eslint-disable-next-line no-restricted-syntax\n connector.actions?.forEach((action: ActionInterface) => {\n if (action.config['templates'] === undefined) {\n return;\n }\n\n const containers: {\n [key: string]: CompileDelegate;\n } = {};\n\n Object.entries(action.config['templates']).forEach(([key, value]) => {\n try {\n // eslint-disable-next-line security/detect-object-injection\n containers[key] = connectorSDK.templating.compile(value);\n } catch (error: unknown) {\n connectorSDK.logger.error(\n `Error compiling template ${key} for action ${action.identifier}`,\n error,\n );\n }\n });\n\n // eslint-disable-next-line no-param-reassign\n action.config['parsedTemplates'] = containers;\n });\n }\n\n public init: () => Promise<void> = () => Promise.resolve();\n\n public start: () => Promise<void> = () => Promise.resolve();\n\n public stop: () => Promise<void> = () => Promise.resolve();\n\n set callbackFunction(\n callback: (\n message: XodJobType,\n action: ActionInterface,\n ) => Promise<KafkaCallbackResponse>,\n ) {\n this.connectorSDK.receiver.registerCallback(\n this.#enrichWithActionConfig(callback),\n );\n }\n\n protected get connectorSDK(): ConnectorSDKInterface<T> {\n return this.#connectorSDK;\n }\n\n #enrichWithActionConfig(\n callbackFunction: (\n message: XodJobType,\n action: ActionInterface,\n ) => Promise<KafkaCallbackResponse>,\n ): (message: XodJobType) => Promise<KafkaCallbackResponse> {\n return async (message: XodJobType) => {\n const action = await this.#connectorSDK.receiver.getActionConfig(message);\n if (!action) {\n return this.#connectorSDK.receiver.responses.badRequest(\n 'Action not found',\n )(message);\n }\n return callbackFunction(message, action);\n };\n }\n}\n", "import { ConnectorRuntimeSDK } from '@transai/connector-runtime-sdk';\nimport {\n ActionInterface,\n BaseConnectorConfig,\n KafkaCallbackResponse,\n XodJobType,\n} from '@xip-online-data/types';\n\nexport class ConnectorRunnerDummyNode extends ConnectorRuntimeSDK<\n {\n failProbability?: number;\n } & BaseConnectorConfig\n> {\n readonly CONNECTOR_INSTANCE: string = 'XOD_CONNECTOR_DUMMY_NODE_CONFIG';\n\n override init = async (): Promise<void> => {\n const { config } = this.connectorSDK;\n\n const failProbability = config.failProbability || 0.0;\n if (failProbability > 0) {\n this.connectorSDK.logger.debug(\n 'Fail probability set to',\n failProbability,\n );\n }\n\n const dummyProcessFailed = (): boolean => {\n return Math.random() < failProbability;\n };\n\n this.callbackFunction = async (\n message: XodJobType,\n action: ActionInterface,\n ): Promise<KafkaCallbackResponse> => {\n this.connectorSDK.logger.info(\n 'Received message: ',\n message.testRun ? '(test run)' : '',\n message.eventId,\n message.payload,\n );\n\n if (dummyProcessFailed()) {\n this.connectorSDK.logger.error('Dummy process failed');\n return this.connectorSDK.receiver.responses.internalServerError(\n 'Dummy process failed',\n )(message);\n }\n\n return this.connectorSDK.receiver.responses.ok()(message);\n };\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAa,eAkBlB,IAAeC,EAAf,KAEgC,CAKrC,YACEC,EACAC,EACA,CAPF,KAASC,GAAe,oBA2DxB,KAAO,KAA4B,IAAM,QAAQ,QAAQ,EAEzD,KAAO,MAA6B,IAAM,QAAQ,QAAQ,EAE1D,KAAO,KAA4B,IAAM,QAAQ,QAAQ,EAvDvD,KAAKC,GAAgBF,EAET,KACF,KAAG,UAAYG,GAAwB,CACzCA,EAAQ,MAAQ,KAAKF,IACvBD,EAAa,OAAO,QAClB,GAAW,KAAG,yCACdG,CACF,CAEJ,CAAC,EAEDH,EAAa,OAAO,KAClB,wDACF,EAGW,QAEXA,EAAa,OAAO,KAClB,0DACF,EAIFD,EAAU,SAAS,QAASK,GAA4B,CACtD,GAAIA,EAAO,OAAO,YAAiB,OACjC,OAGF,IAAMC,EAEF,CAAC,EAEL,OAAO,QAAQD,EAAO,OAAO,SAAY,EAAE,QAAQ,CAAC,CAACE,EAAKC,CAAK,IAAM,CACnE,GAAI,CAEFF,EAAWC,CAAG,EAAIN,EAAa,WAAW,QAAQO,CAAK,CACzD,OAASC,EAAgB,CACvBR,EAAa,OAAO,MAClB,4BAA4BM,CAAG,eAAeF,EAAO,UAAU,GAC/DI,CACF,CACF,CACF,CAAC,EAGDJ,EAAO,OAAO,gBAAqBC,CACrC,CAAC,CACH,CAzDSJ,GAEAC,GA+DT,IAAI,iBACFO,EAIA,CACA,KAAK,aAAa,SAAS,iBACzB,KAAKC,GAAwBD,CAAQ,CACvC,CACF,CAEA,IAAc,cAAyC,CACrD,OAAO,KAAKP,EACd,CAEAQ,GACEC,EAIyD,CACzD,MAAO,OAAOR,GAAwB,CACpC,IAAMC,EAAS,MAAM,KAAKF,GAAc,SAAS,gBAAgBC,CAAO,EACxE,OAAKC,EAKEO,EAAiBR,EAASC,CAAM,EAJ9B,KAAKF,GAAc,SAAS,UAAU,WAC3C,kBACF,EAAEC,CAAO,CAGb,CACF,CACF,EC7GO,IAAMS,EAAN,cAAuCC,CAI5C,CAJK,kCAKL,KAAS,mBAA6B,kCAEtC,KAAS,KAAO,SAA2B,CACzC,GAAM,CAAE,OAAAC,CAAO,EAAI,KAAK,aAElBC,EAAkBD,EAAO,iBAAmB,EAC9CC,EAAkB,GACpB,KAAK,aAAa,OAAO,MACvB,0BACAA,CACF,EAGF,IAAMC,EAAqB,IAClB,KAAK,OAAO,EAAID,EAGzB,KAAK,iBAAmB,MACtBE,EACAC,KAEA,KAAK,aAAa,OAAO,KACvB,qBACAD,EAAQ,QAAU,aAAe,GACjCA,EAAQ,QACRA,EAAQ,OACV,EAEID,EAAmB,GACrB,KAAK,aAAa,OAAO,MAAM,sBAAsB,EAC9C,KAAK,aAAa,SAAS,UAAU,oBAC1C,sBACF,EAAEC,CAAO,GAGJ,KAAK,aAAa,SAAS,UAAU,GAAG,EAAEA,CAAO,EAE5D,EACF",
|
|
6
6
|
"names": ["process", "ConnectorRuntimeSDK", "connector", "connectorSDK", "#IPC_CHANNEL", "#connectorSDK", "message", "action", "containers", "key", "value", "error", "callback", "#enrichWithActionConfig", "callbackFunction", "ConnectorRunnerDummyNode", "ConnectorRuntimeSDK", "config", "failProbability", "dummyProcessFailed", "message", "action"]
|
|
7
7
|
}
|
|
@@ -9,6 +9,6 @@ export interface ReceiverSDKInterface {
|
|
|
9
9
|
readonly internalServerError: KafkaCallbackResponseType;
|
|
10
10
|
};
|
|
11
11
|
registerCallback<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>, eventType?: string, identifier?: string): void;
|
|
12
|
-
getActionConfig(message: XodJobType): ActionInterface | null
|
|
12
|
+
getActionConfig(message: XodJobType): Promise<ActionInterface | null>;
|
|
13
13
|
emitEventType<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>): (message: T) => Promise<KafkaCallbackResponse>;
|
|
14
14
|
}
|
|
@@ -25,7 +25,7 @@ export interface WorkflowRunInterface {
|
|
|
25
25
|
workflow: WorkflowDefinition;
|
|
26
26
|
drawing?: WorkflowDrawing;
|
|
27
27
|
trigger: EventInterface;
|
|
28
|
-
jobs: Array<ActionJob | ConditionalJob | ValidationJob
|
|
28
|
+
jobs: Array<ActionJob | ConditionalJob | ValidationJob>;
|
|
29
29
|
createdAt: Date;
|
|
30
30
|
updatedAt: Date;
|
|
31
31
|
testRun?: boolean;
|
|
@@ -53,10 +53,6 @@ export interface ActionJob extends WorkflowJobInterface {
|
|
|
53
53
|
type: NodeTypes.ACTION;
|
|
54
54
|
with: MessageMapper;
|
|
55
55
|
}
|
|
56
|
-
export interface AgentJob extends WorkflowJobInterface {
|
|
57
|
-
type: NodeTypes.AGENT;
|
|
58
|
-
with: MessageMapper;
|
|
59
|
-
}
|
|
60
56
|
export interface ConditionalJob extends WorkflowJobInterface {
|
|
61
57
|
type: NodeTypes.CONDITIONAL;
|
|
62
58
|
with: ConditionMapper;
|
|
@@ -3,7 +3,6 @@ import { ConditionMapper, MessageMapper } from './workflow-definition.interface'
|
|
|
3
3
|
export declare enum NodeTypes {
|
|
4
4
|
TRIGGER = "TRIGGER",
|
|
5
5
|
ACTION = "ACTION",
|
|
6
|
-
AGENT = "AGENT",
|
|
7
6
|
CONDITIONAL = "CONDITIONAL",
|
|
8
7
|
VALIDATION = "VALIDATION",
|
|
9
8
|
ANNOTATION = "ANNOTATION",
|
|
@@ -36,13 +35,6 @@ export interface ActionNode extends Node {
|
|
|
36
35
|
};
|
|
37
36
|
with: MessageMapper;
|
|
38
37
|
}
|
|
39
|
-
export interface AgentNode extends Node {
|
|
40
|
-
type: NodeTypes.AGENT;
|
|
41
|
-
agent: {
|
|
42
|
-
identifier: string;
|
|
43
|
-
};
|
|
44
|
-
with: MessageMapper;
|
|
45
|
-
}
|
|
46
38
|
export interface TriggerNode extends Node {
|
|
47
39
|
type: NodeTypes.TRIGGER;
|
|
48
40
|
trigger: {
|
|
@@ -72,7 +64,7 @@ export interface PlaceholderNode extends Node {
|
|
|
72
64
|
export interface InvisibleNode extends Node {
|
|
73
65
|
type: NodeTypes.INVISIBLE;
|
|
74
66
|
}
|
|
75
|
-
export type WorkflowNode = ActionNode |
|
|
67
|
+
export type WorkflowNode = ActionNode | ConditionalNode | AnnotationNode | PlaceholderNode | ValidationNode | EndNode | InvisibleNode;
|
|
76
68
|
export interface Edge {
|
|
77
69
|
id: string;
|
|
78
70
|
source: {
|