Skip to content

Commit 80a40c0

Browse files
authored
Merging pull request #18125
1 parent d66263d commit 80a40c0

File tree

4 files changed

+136
-8
lines changed

4 files changed

+136
-8
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import app from "../../rocketskip.app.mjs";
2+
3+
export default {
4+
key: "rocketskip-skip-trace-property",
5+
name: "Skip Trace Property",
6+
description: "Send a property to get phone numbers for the property owner. [See the documentation](https://docs.rocketskip.com/api-reference/endpoint/post)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
streetAddress: {
12+
propDefinition: [
13+
app,
14+
"streetAddress",
15+
],
16+
},
17+
city: {
18+
propDefinition: [
19+
app,
20+
"city",
21+
],
22+
},
23+
state: {
24+
propDefinition: [
25+
app,
26+
"state",
27+
],
28+
},
29+
zipCode: {
30+
propDefinition: [
31+
app,
32+
"zipCode",
33+
],
34+
},
35+
firstName: {
36+
propDefinition: [
37+
app,
38+
"firstName",
39+
],
40+
},
41+
lastName: {
42+
propDefinition: [
43+
app,
44+
"lastName",
45+
],
46+
},
47+
},
48+
async run({ $ }) {
49+
const response = await this.app.skipTraceProperty({
50+
$,
51+
data: {
52+
street_address: this.streetAddress,
53+
city: this.city,
54+
state: this.state,
55+
zip_code: this.zipCode,
56+
first_name: this.firstName,
57+
last_name: this.lastName,
58+
},
59+
});
60+
$.export("$summary", "Successfully sent the request and retrieved " + response.result.length + " resultts");
61+
return response;
62+
},
63+
};

components/rocketskip/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/rocketskip",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream RocketSkip Components",
55
"main": "rocketskip.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.1.0"
1417
}
15-
}
18+
}
Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,69 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "rocketskip",
4-
propDefinitions: {},
6+
propDefinitions: {
7+
streetAddress: {
8+
type: "string",
9+
label: "Street Address",
10+
description: "Street address of the property, i.e.: `44 Montgomery St`",
11+
},
12+
city: {
13+
type: "string",
14+
label: "City",
15+
description: "City of the property, i.e.: `San Francisco`",
16+
},
17+
state: {
18+
type: "string",
19+
label: "State",
20+
description: "State of the property, i.e.: `CA`",
21+
},
22+
zipCode: {
23+
type: "string",
24+
label: "Zip Code",
25+
description: "Postal code of the property, i.e.: `94108`",
26+
},
27+
firstName: {
28+
type: "string",
29+
label: "First Name",
30+
description: "First name of the property owner",
31+
optional: true,
32+
},
33+
lastName: {
34+
type: "string",
35+
label: "Last Name",
36+
description: "Last name of the property owner",
37+
optional: true,
38+
},
39+
},
540
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
41+
_baseUrl() {
42+
return "https://api.rocketskip.com/api/v1";
43+
},
44+
async _makeRequest(opts = {}) {
45+
const {
46+
$ = this,
47+
path,
48+
headers,
49+
...otherOpts
50+
} = opts;
51+
return axios($, {
52+
...otherOpts,
53+
url: this._baseUrl() + path,
54+
headers: {
55+
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
56+
...headers,
57+
},
58+
});
59+
},
60+
61+
async skipTraceProperty(args = {}) {
62+
return this._makeRequest({
63+
path: "/property/skiptrace",
64+
method: "post",
65+
...args,
66+
});
967
},
1068
},
11-
};
69+
};

pnpm-lock.yaml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)