Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Components - faceup #12702

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions components/faceup/faceup.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@ export default {
type: "app",
app: "faceup",
propDefinitions: {},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
},
},
};
methods: {},
};
4 changes: 2 additions & 2 deletions components/faceup/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/faceup",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream FaceUp Components",
"main": "faceup.app.mjs",
"keywords": [
Expand All @@ -12,4 +12,4 @@
"publishConfig": {
"access": "public"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import faceup from "../../faceup.app.mjs";
import sampleEmit from "./test-event.mjs";
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved

export default {
key: "faceup-new-internal-comment-instant",
name: "New Internal Comment (Instant)",
description: "Emit new event when a new internal comment is created. Must create webhook within the Faceup UI and enter the URL of this source to receive events. [See the documentation](https://support.faceup.com/en/article/webhooks)",
version: "0.0.1",
type: "source",
dedupe: "unique",
props: {
faceup,
http: "$.interface.http",
},
methods: {
generateMeta(body) {
const { data: { message } } = body;
return {
id: message.id,
summary: `New Internal Comment ID: ${message.id}`,
ts: Date.parse(message.created_at),
};
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
},
async run(event) {
const { body } = event;
if (body?.event === "InternalCommentCreated") {
const meta = this.generateMeta(body);
this.$emit(body, meta);
}
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
sampleEmit,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
"event": "InternalCommentCreated",
"data": {
"author": {
"id": "TWFuYWdlcjoyMjkzNg==",
"name": "Test User"
},
"message": {
"id": "Q29tcGFueVJlcG9ydEludGVybmFsQ29tbWVudDoyMTIyMQ==",
"created_at": "2024-07-03T16:41:14.397Z"
},
"report": {
"id": "Q29tcGFueVJlcG9ydDozODkyMA=="
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import faceup from "../../faceup.app.mjs";
import sampleEmit from "./test-event.mjs";
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved

export default {
key: "faceup-new-message-instant",
name: "New Message (Instant)",
description: "Emit new event when a new message from a sender is created. Must create webhook within the Faceup UI and enter the URL of this source to receive events. [See the documentation](https://support.faceup.com/en/article/webhooks)",
version: "0.0.1",
type: "source",
dedupe: "unique",
props: {
faceup,
http: "$.interface.http",
},
methods: {
generateMeta(body) {
const { data: { message } } = body;
return {
id: message.id,
summary: `New Message ID: ${message.id}`,
ts: Date.parse(message.created_at),
};
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
},
async run(event) {
const { body } = event;
if (body?.event === "MessageCreated") {
const meta = this.generateMeta(body);
this.$emit(body, meta);
}
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
sampleEmit,
};
15 changes: 15 additions & 0 deletions components/faceup/sources/new-message-instant/test-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
"event": "MessageCreated",
"data": {
"message": {
"id": "Q29tcGFueVJlcG9ydEZvbGxvd1VwQ29tbWVudDozMTEzOA==",
"created_at": "2024-07-03T16:40:01.276Z"
},
"author": {
"type": "member"
},
"report": {
"id": "Q29tcGFueVJlcG9ydDozODkyMA=="
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import faceup from "../../faceup.app.mjs";
import sampleEmit from "./test-event.mjs";
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved

export default {
key: "faceup-new-report-instant",
name: "New Report (Instant)",
description: "Emit new event when a new report is created. Must create webhook within the Faceup UI and enter the URL of this source to receive events. [See the documentation](https://support.faceup.com/en/article/webhooks)",
version: "0.0.1",
type: "source",
dedupe: "unique",
props: {
faceup,
http: "$.interface.http",
},
methods: {
generateMeta(body) {
const { data: { report } } = body;
return {
id: report.id,
summary: `New Report ID: ${report.id}`,
ts: Date.parse(report.created_at),
};
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
},
async run(event) {
const { body } = event;
if (body?.event === "ReportCreated") {
const meta = this.generateMeta(body);
this.$emit(body, meta);
}
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
sampleEmit,
};
15 changes: 15 additions & 0 deletions components/faceup/sources/new-report-instant/test-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
"event": "ReportCreated",
"data": {
"report": {
"id": "Q29tcGFueVJlcG9ydDozOTE4MQ==",
"tag": "#bc11e",
"origin": "Member",
"justification": "Unknown",
"priority": null,
"status": "Open",
"source": "ReportingSystem",
"created_at": "2024-07-03T04:00:00.000Z"
}
}
}
Loading