Skip to content

Commit 9be96a7

Browse files
committed
updates
1 parent 1744391 commit 9be96a7

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

components/frontapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/frontapp",
3-
"version": "0.8.1",
3+
"version": "0.8.2",
44
"description": "Pipedream Frontapp Components",
55
"main": "frontapp.app.mjs",
66
"keywords": [

components/frontapp/sources/common/base.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ export default {
4545
if (filterFn) {
4646
responseArray.sort((a, b) => b.created_at - a.created_at);
4747
}
48-
this._setLastTs(this._getEmit(responseArray[0]).ts);
48+
this._setLastTs(this._getEmit(responseArray[0])?.ts ?? 0);
4949
}
5050

5151
for (const item of responseArray.reverse()) {
52+
const emit = this._getEmit(item);
53+
if (!emit) {
54+
continue;
55+
}
5256
this.$emit(
5357
item,
54-
this._getEmit(item),
58+
emit,
5559
);
5660
}
5761
},

components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "frontapp-new-conversation-tag",
77
name: "New Conversation Tag",
88
description: "Emit new event when a conversation is tagged with a specific tag or any tag. [See the documentation](https://dev.frontapp.com/reference/events)",
9-
version: "0.0.5",
9+
version: "0.0.6",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {
@@ -24,9 +24,8 @@ export default {
2424
_getFunction() {
2525
return this.frontapp.listEvents;
2626
},
27-
_getParams(lastTs) {
27+
_getParams() {
2828
return {
29-
"q[after]": lastTs,
3029
"q[types]": [
3130
"tag",
3231
],
@@ -39,11 +38,19 @@ export default {
3938
if (item.type === "tag" && tagIdsArray.includes(item.target?.data?.id)) {
4039
return {
4140
id: item.id,
42-
summary: `New conversation with id: "${item.id}" was tagged as '${item.target?.data?.name}'!`,
43-
ts: Date.parse(item.created_at),
41+
summary: `Conversation with ID: "${item.id}" was tagged as '${item.target?.data?.name}'!`,
42+
ts: (Math.floor(item.emitted_at / 1000)) * 1000,
4443
};
4544
}
4645
},
4746
},
47+
hooks: {
48+
async deploy() {
49+
await this.startEvent(10, (item, lastTs) => item.emitted_at > lastTs);
50+
},
51+
},
52+
async run() {
53+
await this.startEvent(0, (item, lastTs) => item.emitted_at > lastTs);
54+
},
4855
sampleEmit,
4956
};

0 commit comments

Comments
 (0)