@things-factory/integration-base 6.1.18 → 6.1.22
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.
@@ -17,7 +17,7 @@ async function StopScenario(step, context) {
|
|
17
17
|
await engine_1.ScenarioEngine.unload(domain, foundScenario === null || foundScenario === void 0 ? void 0 : foundScenario.name);
|
18
18
|
logger.info(`Scenario '${foundScenario === null || foundScenario === void 0 ? void 0 : foundScenario.name}' is about to be stopped.`);
|
19
19
|
return {
|
20
|
-
data: null
|
20
|
+
data: foundScenario === null || foundScenario === void 0 ? void 0 : foundScenario.name
|
21
21
|
};
|
22
22
|
}
|
23
23
|
StopScenario.parameterSpec = [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stop-scenario.js","sourceRoot":"","sources":["../../../server/engine/task/stop-scenario.ts"],"names":[],"mappings":";;AAAA,iDAAqD;
|
1
|
+
{"version":3,"file":"stop-scenario.js","sourceRoot":"","sources":["../../../server/engine/task/stop-scenario.ts"],"names":[],"mappings":";;AAAA,iDAAqD;AAErD,2CAAwC;AACxC,yCAA6C;AAC7C,oDAA+C;AAE/C,KAAK,UAAU,YAAY,CAAC,IAAI,EAAE,OAAO;IACvC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IAChC,IAAI,EACF,MAAM,EAAE,EAAE,QAAQ,EAAE,EACrB,GAAG,IAAI,CAAA;IAER,sCAAsC;IACtC,IAAI,aAAa,GAAG,MAAM,IAAA,qBAAa,EAAC,kBAAQ,CAAC,CAAC,OAAO,CAAC;QACxD,KAAK,EAAE;YACL,EAAE,EAAE,QAAQ;SACb;QACD,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;KAC/B,CAAC,CAAA;IAEF,MAAM,uBAAc,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CAAC,CAAA;IACxD,MAAM,CAAC,IAAI,CAAC,aAAa,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,2BAA2B,CAAC,CAAA;IAExE,OAAO;QACL,IAAI,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI;KAC1B,CAAA;AACH,CAAC;AAED,YAAY,CAAC,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE;YACR,SAAS,EAAE,WAAW;SACvB;KACF;CACF,CAAA;AAED,YAAY,CAAC,aAAa,GAAG,IAAI,CAAA;AAEjC,4BAAY,CAAC,mBAAmB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { Scenario } from '../../service'\nimport { ScenarioEngine } from '../../engine'\nimport { TaskRegistry } from '../task-registry'\n\nasync function StopScenario(step, context) {\n var { logger, domain } = context\n var {\n params: { scenario }\n } = step\n\n // find the name of the input scenario\n var foundScenario = await getRepository(Scenario).findOne({\n where: {\n id: scenario\n },\n relations: ['steps', 'domain']\n })\n\n await ScenarioEngine.unload(domain, foundScenario?.name)\n logger.info(`Scenario '${foundScenario?.name}' is about to be stopped.`)\n\n return {\n data: foundScenario?.name\n }\n}\n\nStopScenario.parameterSpec = [\n {\n type: 'entity-selector',\n name: 'scenario',\n label: 'scenario',\n property: {\n queryName: 'scenarios'\n }\n }\n]\n\nStopScenario.connectorFree = true\n\nTaskRegistry.registerTaskHandler('scenario-stop', StopScenario)\n"]}
|