Skip to content
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
3 changes: 0 additions & 3 deletions components/tubular/.gitignore

This file was deleted.

62 changes: 62 additions & 0 deletions components/tubular/actions/create-lead/create-lead.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import app from "../../tubular.app.mjs";

export default {
key: "tubular-create-lead",
name: "Create Lead",
description: "Create lead and return its ID. [See the documentation](https://developer.tubular.io/examples/#create-lead-and-return-its-id)",
version: "0.0.1",
type: "action",
props: {
app,
firstName: {
propDefinition: [
app,
"firstName",
],
},
lastName: {
propDefinition: [
app,
"lastName",
],
},
note: {
propDefinition: [
app,
"note",
],
},
lead: {
propDefinition: [
app,
"lead",
],
},
},
async run({ $ }) {
const query = `
mutation {
addContact(input: {
firstName: "${this.firstName}",
lastName: "${this.lastName}",
note: "${this.note}",
lead: ${this.lead}
}) {
contact {
id
}
}
}
`;

const response = await this.app.post({
$,
data: {
query,
},
});

$.export("$summary", "Successfully created Lead with ID: " + response.data.addContact.contact.id);
return response;
},
};
41 changes: 41 additions & 0 deletions components/tubular/actions/get-deals-by-date/get-deals-by-date.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import app from "../../tubular.app.mjs";

export default {
key: "tubular-get-deals-by-date",
name: "Get Deals By Date",
description: "Get deals ordered by date of creation. [See the documentation](https://developer.tubular.io/examples/#get-deals-ordered-by-date-of-creation)",
version: "0.0.1",
type: "action",
props: {
app,
},
async run({ $ }) {
const query = `{
viewer{
pipelines(first:100){
edges{
node{
deals(orderBy:CREATED_AT, direction: DESC){
edges{
node{
id
name
currency
}
}
}
}
}
}
}
}`;
const response = await this.app.post({
$,
data: {
query,
},
});
$.export("$summary", "Successfully fetched Deals");
return response;
},
};
36 changes: 36 additions & 0 deletions components/tubular/actions/get-leads/get-leads.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import app from "../../tubular.app.mjs";

export default {
key: "tubular-get-leads",
name: "Get Leads",
description: "Get leads ordered by date of creation. [See the documentation](https://developer.tubular.io/examples/#get-first-10-leads)",
version: "0.0.1",
type: "action",
props: {
app,
},
async run({ $ }) {
const query = `{
viewer{
leads(first: 100){
edges{
node{
id
fullName
email
lead
}
}
}
}
}`;
const response = await this.app.post({
$,
data: {
query,
},
});
$.export("$summary", "Successfully fetched Leads");
return response;
},
};
13 changes: 0 additions & 13 deletions components/tubular/app/tubular.app.ts

This file was deleted.

8 changes: 5 additions & 3 deletions components/tubular/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "@pipedream/tubular",
"version": "0.0.2",
"version": "0.1.0",
"description": "Pipedream Tubular Components",
"main": "dist/app/tubular.app.mjs",
"main": "tubular.app.mjs",
"keywords": [
"pipedream",
"tubular"
],
"files": ["dist"],
"homepage": "https://pipedream.com/apps/tubular",
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
54 changes: 54 additions & 0 deletions components/tubular/tubular.app.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "tubular",
propDefinitions: {
firstName: {
type: "string",
label: "First Name",
description: "The contact's first name",
},
lastName: {
type: "string",
label: "Last Name",
description: "The contact's last name",
},
note: {
type: "string",
label: "Note",
description: "A note about the contact",
},
lead: {
type: "boolean",
label: "Lead",
description: "Indicates whether the contact is a lead",
},
},
methods: {
_baseUrl() {
return "https://api.tubular.io/graphql";
},
async _makeRequest(opts = {}) {
const {
$ = this,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl(),
headers: {
"Authorization": `${this.$auth.api_token}`,
...headers,
},
});
},
async post(args = {}) {
return this._makeRequest({
method: "POST",
...args,
});
},
},
};
14 changes: 5 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading