@pipedream/vestaboard 0.1.0 → 0.1.1
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.
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "vestaboard-create-message",
|
|
6
6
|
name: "Create Message",
|
|
7
7
|
description: "Creates a new message for a subscription. [See the docs](https://swagger.vestaboard.com/docs/vestaboard/b3A6MTYwMTA4OTc-post-v2-0-subscriptions-with-id-message)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.2",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
vestaboard,
|
|
@@ -29,16 +29,28 @@ export default {
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
async run({ $ }) {
|
|
32
|
-
|
|
32
|
+
const {
|
|
33
|
+
subscriptionId,
|
|
34
|
+
text,
|
|
35
|
+
characters,
|
|
36
|
+
} = this;
|
|
37
|
+
|
|
38
|
+
if (!text && !characters) {
|
|
33
39
|
throw new ConfigurationError("Either `text` or `characters` must be entered");
|
|
34
40
|
}
|
|
35
41
|
|
|
42
|
+
const data = {};
|
|
43
|
+
if (text) {
|
|
44
|
+
data.text = text;
|
|
45
|
+
} else {
|
|
46
|
+
data.characters = Array.isArray(characters)
|
|
47
|
+
? characters
|
|
48
|
+
: JSON.parse(characters);
|
|
49
|
+
}
|
|
50
|
+
|
|
36
51
|
const response = await this.vestaboard.createMessage({
|
|
37
|
-
subscriptionId
|
|
38
|
-
data
|
|
39
|
-
text: this.text,
|
|
40
|
-
characters: this.characters,
|
|
41
|
-
},
|
|
52
|
+
subscriptionId,
|
|
53
|
+
data,
|
|
42
54
|
$,
|
|
43
55
|
});
|
|
44
56
|
|