UNPKG

761 BJavaScriptView Raw
1// triggers on <%= LOWER_NOUN %> with a certain tag
2const trigger<%= CAMEL %> = (z, bundle) => {
3 const responsePromise = z.request({
4 url: 'https://jsonplaceholder.typicode.com/posts',
5 params: {
6 tag: bundle.inputData.tagName
7 }
8 });
9 return responsePromise
10 .then(response => z.JSON.parse(response.content));
11};
12
13module.exports = {
14 key: '<%= KEY %>',
15 noun: '<%= NOUN %>',
16
17 display: {
18 label: 'Get <%= NOUN %>',
19 description: 'Triggers on a new <%= LOWER_NOUN %>.'
20 },
21
22 operation: {
23 inputFields: [
24 <%= INPUT_FIELDS %>
25 ],
26 perform: trigger<%= CAMEL %>,
27
28 sample: {
29 id: 1,
30 name: 'Test'
31 },
32
33 outputFields: [
34 {key: 'id', label: 'ID'},
35 {key: 'name', label: 'Name'}
36 ]
37 }
38};