@reuters-graphics/teams-klaxon
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -43,3 +43,3 @@ 'use strict'; | ||
const formatMessage = ({ title, text, facts, images, stackTrace, linkButtons }) => { | ||
const formatMessage = ({ color = '666666', title, text, facts, images, stackTrace, linkButtons }) => { | ||
const message = { | ||
@@ -49,3 +49,3 @@ '@context': 'https://schema.org/extensions', | ||
version: '1.0', | ||
themeColor: '666666', | ||
themeColor: color, | ||
text, | ||
@@ -80,2 +80,6 @@ }; | ||
text: { type: 'string' }, | ||
color: { | ||
type: 'string', | ||
pattern: '^[A-Fa-f0-9]{6}$', | ||
}, | ||
facts: { | ||
@@ -82,0 +86,0 @@ type: 'object', |
{ | ||
"name": "@reuters-graphics/teams-klaxon", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/reuters-graphics/teams-klaxon", |
@@ -75,2 +75,3 @@ ![](badge.svg) | ||
stackTrace: { | ||
title: 'Stack trace', | ||
code: 'console.log(\'hello world\'!)', | ||
@@ -100,2 +101,43 @@ }, | ||
#### Color | ||
```javascript | ||
await klaxon.log({ | ||
title: '⚙️ Testing color', | ||
color: 'FF0000' | ||
}); | ||
``` | ||
![](./images/color.png) | ||
#### Multiple options | ||
```javascript | ||
await klaxon.log({ | ||
title: '⚙️ Testing multiple options', | ||
color: 'FF0000', | ||
facts: { | ||
Name: 'Jon McClure', | ||
Age: '35', | ||
}, | ||
images: [ | ||
'https://scitechdaily.com/images/Great-White-Shark-Smile-1536x1152.jpg', | ||
'https://cdn.britannica.com/79/65379-050-5CF52BAC/Shortfin-mako-shark-seas.jpg', | ||
], | ||
stackTrace: { | ||
code: 'console.log(\'hello world!\')', | ||
}, | ||
linkButtons: [{ | ||
name: 'Google', | ||
link: 'https://www.google.com', | ||
}, { | ||
name: 'Twitter', | ||
link: 'https://www.twitter.com', | ||
}], | ||
}); | ||
``` | ||
![](./images/multiple.png) | ||
## Testing | ||
@@ -102,0 +144,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92985
124
146