@shushed/helpers 0.0.137 → 0.0.138
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/dist/index.js +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -171421,6 +171421,7 @@ var TriggerHelper = class {
|
|
|
171421
171421
|
onExecute() {
|
|
171422
171422
|
const fn = async (config, options) => {
|
|
171423
171423
|
let executionFinished = false;
|
|
171424
|
+
let terminateResult = null;
|
|
171424
171425
|
let message;
|
|
171425
171426
|
const optionsEnchanced = {
|
|
171426
171427
|
...options,
|
|
@@ -171428,11 +171429,13 @@ var TriggerHelper = class {
|
|
|
171428
171429
|
...options.req,
|
|
171429
171430
|
throw: (code, message2) => {
|
|
171430
171431
|
executionFinished = true;
|
|
171432
|
+
terminateResult = { code, message: message2 };
|
|
171431
171433
|
options.req.throw(code, message2);
|
|
171432
171434
|
}
|
|
171433
171435
|
},
|
|
171434
171436
|
terminate: (statusCode, message2) => {
|
|
171435
171437
|
executionFinished = true;
|
|
171438
|
+
terminateResult = { code: statusCode, message: message2 };
|
|
171436
171439
|
return options.terminate(statusCode, message2);
|
|
171437
171440
|
}
|
|
171438
171441
|
};
|
|
@@ -171544,6 +171547,7 @@ var TriggerHelper = class {
|
|
|
171544
171547
|
if (!apiKeyIsValid && (action.actionOptions.routingConditions || {}).havingApiKey) {
|
|
171545
171548
|
return optionsEnchanced.req.throw(401, `Invalid Authorization Header`);
|
|
171546
171549
|
}
|
|
171550
|
+
options.logging.log("Action matched preparing to execute - ", action.actionOptions);
|
|
171547
171551
|
try {
|
|
171548
171552
|
await action.onExecute(config, optionsEnchanced, message);
|
|
171549
171553
|
} catch (error) {
|
|
@@ -171555,6 +171559,9 @@ var TriggerHelper = class {
|
|
|
171555
171559
|
}
|
|
171556
171560
|
}
|
|
171557
171561
|
if (executionFinished) {
|
|
171562
|
+
if (terminateResult) {
|
|
171563
|
+
options.logging.log("Trigger finished without triggering the rest of workflow", action.actionOptions);
|
|
171564
|
+
}
|
|
171558
171565
|
return;
|
|
171559
171566
|
}
|
|
171560
171567
|
}
|