refactor: Use pushTriggerItem utility function for triggers
This commit is contained in:
@@ -44,7 +44,7 @@ const newIssues = async ($: IGlobalVariable) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (links.next && !$.execution.testRun);
|
} while (links.next && !$.execution.testRun);
|
||||||
|
@@ -55,7 +55,7 @@ const newStargazers = async ($: IGlobalVariable) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (pathname && !$.execution.testRun);
|
} while (pathname && !$.execution.testRun);
|
||||||
|
@@ -171,6 +171,6 @@ export default defineTrigger({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -65,6 +65,6 @@ export default defineTrigger({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -287,6 +287,6 @@ export default defineTrigger({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -191,6 +191,6 @@ export default defineTrigger({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -30,12 +30,14 @@ const fetchTweets = async ($: IGlobalVariable, username: string) => {
|
|||||||
|
|
||||||
if (response.data.meta.result_count > 0) {
|
if (response.data.meta.result_count > 0) {
|
||||||
response.data.data.forEach((tweet: IJSONObject) => {
|
response.data.data.forEach((tweet: IJSONObject) => {
|
||||||
$.triggerOutput.data.push({
|
const dataItem = {
|
||||||
raw: tweet,
|
raw: tweet,
|
||||||
meta: {
|
meta: {
|
||||||
internalId: tweet.id as string,
|
internalId: tweet.id as string,
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
|
||||||
|
$.pushTriggerItem(dataItem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} while (response.data.meta.next_token && !$.execution.testRun);
|
} while (response.data.meta.next_token && !$.execution.testRun);
|
||||||
|
@@ -35,7 +35,7 @@ const searchTweets = async ($: IGlobalVariable) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
$.triggerOutput.data.push(dataItem);
|
$.pushTriggerItem(dataItem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} while (response.data.meta.next_token && !$.execution.testRun);
|
} while (response.data.meta.next_token && !$.execution.testRun);
|
||||||
|
Reference in New Issue
Block a user