feat: Add hardened error handling and retries (#2451)

- Closes #1830
 - Closes #2099
This commit is contained in:
Dermot Duffy
2026-06-30 17:45:12 -07:00
committed by dermotduffy
parent 4bc787e2b7
commit 47bcce93d3
182 changed files with 7877 additions and 4043 deletions
@@ -0,0 +1,12 @@
import yaml from 'js-yaml';
// Converts a structured data object into preformatted text strings for a
// notification's context section. Arrays produce one string per item (strings
// pass through; objects are YAML-dumped); all other objects produce a single
// YAML-dumped string.
export const dataToContext = (data: object): string[] => {
if (Array.isArray(data)) {
return data.map((item) => (typeof item === 'string' ? item : yaml.dump(item)));
}
return [yaml.dump(data)];
};