@transai/connector-runner-dummy-node 0.26.6 → 0.27.0

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.26.6 (2026-11-02)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated @transai/connector-runtime-sdk to 0.22.6
6
+
1
7
  ## 0.26.5 (2026-10-27)
2
8
 
3
9
  ### 🧱 Updated Dependencies
package/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.create;var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var y=(t,r)=>{for(var e in r)s(t,e,{get:r[e],enumerable:!0})},m=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of g(r))!b.call(t,n)&&n!==e&&s(t,n,{get:()=>r[n],enumerable:!(o=d(r,n))||o.enumerable});return t};var P=(t,r,e)=>(e=t!=null?l(I(t)):{},m(r||!t||!t.__esModule?s(e,"default",{value:t,enumerable:!0}):e,t)),x=t=>m(s({},"__esModule",{value:!0}),t);var C={};y(C,{ConnectorRunnerDummyNode:()=>p});module.exports=x(C);var a=P(require("node:process")),c=class{#r="connector-runtime";#e;constructor(r,e){this.#e=e,a.default.on?a.default.on("message",o=>{o.cmd===this.#r&&e.logger.verbose(`${a.default.pid} Received message from parent process:`,o)}):e.logger.warn("IPC channel is not available. process.on is undefined."),a.default.send||e.logger.warn("IPC channel is not available. process.send is undefined."),r.actions?.forEach(o=>{if(o.config.templates===void 0)return;let n={};Object.entries(o.config.templates).forEach(([i,f])=>{try{n[i]=e.templating.compile(f)}catch(u){e.logger.error(`Error compiling template ${i} for action ${o.identifier}`,u)}}),o.config.parsedTemplates=n})}init=()=>Promise.resolve();start=()=>Promise.resolve();stop=()=>Promise.resolve();set callbackFunction(r){this.connectorSDK.receiver.registerCallback(this.#t(r))}get connectorSDK(){return this.#e}#t(r){return async e=>{let o=await this.#e.receiver.getActionConfig(e);return o?r(e,o):this.#e.receiver.responses.badRequest("Action not found")(e)}}};var p=class extends c{CONNECTOR_INSTANCE="XOD_CONNECTOR_DUMMY_NODE_CONFIG";init=async()=>{let{config:r}=this.connectorSDK,e=r.failProbability||0;e>0&&this.connectorSDK.logger.debug("Fail probability set to",e);let o=n=>Math.random()<(n??e);this.callbackFunction=async(n,i)=>(this.connectorSDK.logger.info("Received message: ",n.testRun?"(test run)":"",n.eventId,n.payload),o(i.config?.failProbability)?(this.connectorSDK.logger.error("Dummy process failed"),this.connectorSDK.receiver.responses.internalServerError("Dummy process failed")(n)):this.connectorSDK.receiver.responses.ok()(n))}};0&&(module.exports={ConnectorRunnerDummyNode});
1
+ "use strict";var u=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var y=(n,r)=>{for(var e in r)p(n,e,{get:r[e],enumerable:!0})},f=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of d(r))!I.call(n,a)&&a!==e&&p(n,a,{get:()=>r[a],enumerable:!(t=g(r,a))||t.enumerable});return n};var P=(n,r,e)=>(e=n!=null?u(b(n)):{},f(r||!n||!n.__esModule?p(e,"default",{value:n,enumerable:!0}):e,n)),C=n=>f(p({},"__esModule",{value:!0}),n);var x={};y(x,{ConnectorRunnerDummyNode:()=>c});module.exports=C(x);var s=P(require("node:process")),m=class{#r="connector-runtime";#e;constructor(r,e){this.#e=e,s.default.on?s.default.on("message",t=>{t.cmd===this.#r&&e.logger.verbose(`${s.default.pid} Received message from parent process:`,t)}):e.logger.warn("IPC channel is not available. process.on is undefined."),s.default.send||e.logger.warn("IPC channel is not available. process.send is undefined."),r.actions?.forEach(t=>{if(t.config.templates===void 0)return;let a={};Object.entries(t.config.templates).forEach(([o,i])=>{try{a[o]=e.templating.compile(i)}catch(l){e.logger.error(`Error compiling template ${o} for action ${t.identifier}`,l)}}),t.config.parsedTemplates=a})}init=()=>Promise.resolve();start=()=>Promise.resolve();stop=()=>Promise.resolve();set callbackFunction(r){this.connectorSDK.receiver.registerCallback(this.#t(r))}get connectorSDK(){return this.#e}#t(r){return async e=>{let t=await this.#e.receiver.getActionConfig(e);return t?r(e,t):this.#e.receiver.responses.badRequest("Action not found")(e)}}};var c=class extends m{CONNECTOR_INSTANCE="XOD_CONNECTOR_DUMMY_NODE_CONFIG";init=async()=>{let{config:r,logger:e,receiver:t}=this.connectorSDK;(r.failProbability||r.temporarilyUnavailableProbability)&&e.debug("Fail probability set to",r.failProbability??0,"temporarily unavailable probability set to",r.temporarilyUnavailableProbability??0);let a=(o,i)=>Math.random()<(i?.[o]??r[o]??0);this.callbackFunction=async(o,i)=>(e.info("Received message: ",o.testRun?"(test run)":"",o.eventId,o.payload),a("temporarilyUnavailableProbability",i.config)?(e.warn("Dummy target temporarily unavailable"),t.responses.temporarilyUnavailable("Dummy target temporarily unavailable")(o)):a("failProbability",i.config)?(e.error("Dummy process failed"),t.responses.internalServerError("Dummy process failed")(o)):t.responses.ok()(o))}};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": ["../../../integrations/connector-runner-dummy-node/src/index.ts", "../../../libs/connector-runtime-sdk/src/lib/connector-runtime.ts", "../../../integrations/connector-runner-dummy-node/src/lib/connector-runner-dummy-node.ts"],
4
- "sourcesContent": ["export * from './lib/connector-runner-dummy-node';\n", "import process from 'node:process';\n\nimport { ConnectorRuntimeInterface } from './connector-runtime.interface';\nimport { CompileDelegate, ConnectorSDKInterface } from './sdk';\nimport {\n ActionInterface,\n BaseConnectorConfig,\n ConnectorInterface,\n KafkaCallbackResponse,\n XodJobType,\n} from './types';\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 {\n BaseConnectorConfig,\n ConnectorRuntimeSDK,\n KafkaCallbackResponse,\n XodJobType,\n} from '@transai/connector-runtime-sdk';\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 connectorFailProbability = config.failProbability || 0.0;\n if (connectorFailProbability > 0) {\n this.connectorSDK.logger.debug(\n 'Fail probability set to',\n connectorFailProbability,\n );\n }\n\n const dummyProcessFailed = (actionFailPropability?: number): boolean => {\n return (\n Math.random() < (actionFailPropability ?? connectorFailProbability)\n );\n };\n\n this.callbackFunction = async (\n message: XodJobType,\n action: { config: { failProbability?: number } },\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(action.config?.failProbability)) {\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,EAAoB,2BAiBEC,EAAf,KAEgC,CAC5BC,GAAe,oBAEfC,GAET,YACEC,EACAC,EACA,CACA,KAAKF,GAAgBE,EAEjB,EAAAC,QAAQ,GACV,EAAAA,QAAQ,GAAG,UAAYC,GAAwB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MACvB,0BACAA,CACF,EAGF,IAAMC,EAAsBC,GAExB,KAAK,OAAO,GAAKA,GAAyBF,GAI9C,KAAK,iBAAmB,MACtBG,EACAC,KAEA,KAAK,aAAa,OAAO,KACvB,qBACAD,EAAQ,QAAU,aAAe,GACjCA,EAAQ,QACRA,EAAQ,OACV,EAEIF,EAAmBG,EAAO,QAAQ,eAAe,GACnD,KAAK,aAAa,OAAO,MAAM,sBAAsB,EAC9C,KAAK,aAAa,SAAS,UAAU,oBAC1C,sBACF,EAAED,CAAO,GAGJ,KAAK,aAAa,SAAS,UAAU,GAAG,EAAEA,CAAO,EAE5D,CACF",
6
- "names": ["index_exports", "__export", "ConnectorRunnerDummyNode", "__toCommonJS", "import_node_process", "ConnectorRuntimeSDK", "#IPC_CHANNEL", "#connectorSDK", "connector", "connectorSDK", "process", "message", "action", "containers", "key", "value", "error", "callback", "#enrichWithActionConfig", "callbackFunction", "ConnectorRunnerDummyNode", "ConnectorRuntimeSDK", "config", "connectorFailProbability", "dummyProcessFailed", "actionFailPropability", "message", "action"]
4
+ "sourcesContent": ["export * from './lib/connector-runner-dummy-node';\n", "import process from 'node:process';\n\nimport { ConnectorRuntimeInterface } from './connector-runtime.interface';\nimport { CompileDelegate, ConnectorSDKInterface } from './sdk';\nimport {\n ActionInterface,\n BaseConnectorConfig,\n ConnectorInterface,\n KafkaCallbackResponse,\n XodJobType,\n} from './types';\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 {\n BaseConnectorConfig,\n ConnectorRuntimeSDK,\n KafkaCallbackResponse,\n XodJobType,\n} from '@transai/connector-runtime-sdk';\n\n/** Probabilities between 0 and 1; an action's value overrides the connector's. */\nexport interface IDummyFailureConfig {\n /** Chance of a non-retryable failure (`internalServerError`). */\n failProbability?: number;\n /** Chance of a retryable failure (`temporarilyUnavailable`), checked before `failProbability`. */\n temporarilyUnavailableProbability?: number;\n}\n\nexport type DummyNodeConfig = IDummyFailureConfig & BaseConnectorConfig;\n\nexport class ConnectorRunnerDummyNode extends ConnectorRuntimeSDK<DummyNodeConfig> {\n readonly CONNECTOR_INSTANCE: string = 'XOD_CONNECTOR_DUMMY_NODE_CONFIG';\n\n override init = async (): Promise<void> => {\n const { config, logger, receiver } = this.connectorSDK;\n\n if (config.failProbability || config.temporarilyUnavailableProbability) {\n logger.debug(\n 'Fail probability set to',\n config.failProbability ?? 0,\n 'temporarily unavailable probability set to',\n config.temporarilyUnavailableProbability ?? 0,\n );\n }\n\n const happens = (\n key: keyof IDummyFailureConfig,\n actionConfig?: IDummyFailureConfig,\n ): boolean =>\n // eslint-disable-next-line security/detect-object-injection -- key is a fixed union of config names\n Math.random() < (actionConfig?.[key] ?? config[key] ?? 0);\n\n this.callbackFunction = async (\n message: XodJobType,\n action: { config?: IDummyFailureConfig },\n ): Promise<KafkaCallbackResponse> => {\n logger.info(\n 'Received message: ',\n message.testRun ? '(test run)' : '',\n message.eventId,\n message.payload,\n );\n\n if (happens('temporarilyUnavailableProbability', action.config)) {\n logger.warn('Dummy target temporarily unavailable');\n\n return receiver.responses.temporarilyUnavailable(\n 'Dummy target temporarily unavailable',\n )(message);\n }\n\n if (happens('failProbability', action.config)) {\n logger.error('Dummy process failed');\n\n return receiver.responses.internalServerError('Dummy process failed')(\n message,\n );\n }\n\n return receiver.responses.ok()(message);\n };\n };\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAAoB,2BAiBEC,EAAf,KAEgC,CAC5BC,GAAe,oBAEfC,GAET,YACEC,EACAC,EACA,CACA,KAAKF,GAAgBE,EAEjB,EAAAC,QAAQ,GACV,EAAA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AO,iBAAmBA,EAAO,oCACnCC,EAAO,MACL,0BACAD,EAAO,iBAAmB,EAC1B,6CACAA,EAAO,mCAAqC,CAC9C,EAGF,IAAMG,EAAU,CACdC,EACAC,IAGA,KAAK,OAAO,GAAKA,IAAeD,CAAG,GAAKJ,EAAOI,CAAG,GAAK,GAEzD,KAAK,iBAAmB,MACtBE,EACAC,KAEAN,EAAO,KACL,qBACAK,EAAQ,QAAU,aAAe,GACjCA,EAAQ,QACRA,EAAQ,OACV,EAEIH,EAAQ,oCAAqCI,EAAO,MAAM,GAC5DN,EAAO,KAAK,sCAAsC,EAE3CC,EAAS,UAAU,uBACxB,sCACF,EAAEI,CAAO,GAGPH,EAAQ,kBAAmBI,EAAO,MAAM,GAC1CN,EAAO,MAAM,sBAAsB,EAE5BC,EAAS,UAAU,oBAAoB,sBAAsB,EAClEI,CACF,GAGKJ,EAAS,UAAU,GAAG,EAAEI,CAAO,EAE1C,CACF",
6
+ "names": ["index_exports", "__export", "ConnectorRunnerDummyNode", "__toCommonJS", "import_node_process", "ConnectorRuntimeSDK", "#IPC_CHANNEL", "#connectorSDK", "connector", "connectorSDK", "process", "message", "action", "containers", "key", "value", "error", "callback", "#enrichWithActionConfig", "callbackFunction", "ConnectorRunnerDummyNode", "ConnectorRuntimeSDK", "config", "logger", "receiver", "happens", "key", "actionConfig", "message", "action"]
7
7
  }
@@ -1,7 +1,13 @@
1
1
  import { BaseConnectorConfig, ConnectorRuntimeSDK } from '@transai/connector-runtime-sdk';
2
- export declare class ConnectorRunnerDummyNode extends ConnectorRuntimeSDK<{
2
+ /** Probabilities between 0 and 1; an action's value overrides the connector's. */
3
+ export interface IDummyFailureConfig {
4
+ /** Chance of a non-retryable failure (`internalServerError`). */
3
5
  failProbability?: number;
4
- } & BaseConnectorConfig> {
6
+ /** Chance of a retryable failure (`temporarilyUnavailable`), checked before `failProbability`. */
7
+ temporarilyUnavailableProbability?: number;
8
+ }
9
+ export type DummyNodeConfig = IDummyFailureConfig & BaseConnectorConfig;
10
+ export declare class ConnectorRunnerDummyNode extends ConnectorRuntimeSDK<DummyNodeConfig> {
5
11
  readonly CONNECTOR_INSTANCE: string;
6
12
  init: () => Promise<void>;
7
13
  }
@@ -7,6 +7,7 @@ export interface ReceiverSDKInterface {
7
7
  readonly unprocessableEntity: KafkaCallbackResponseType;
8
8
  readonly notFound: KafkaCallbackResponseType;
9
9
  readonly internalServerError: KafkaCallbackResponseType;
10
+ readonly temporarilyUnavailable: KafkaCallbackResponseType;
10
11
  };
11
12
  registerCallback<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>, eventType?: string, identifier?: string): void;
12
13
  getActionConfig(message: XodJobType): Promise<ActionInterface | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transai/connector-runner-dummy-node",
3
- "version": "0.26.6",
3
+ "version": "0.27.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },