diff --git a/components/rocketskip/actions/skip-trace-property/skip-trace-property.mjs b/components/rocketskip/actions/skip-trace-property/skip-trace-property.mjs new file mode 100644 index 0000000000000..f9b013fdb109f --- /dev/null +++ b/components/rocketskip/actions/skip-trace-property/skip-trace-property.mjs @@ -0,0 +1,63 @@ +import app from "../../rocketskip.app.mjs"; + +export default { + key: "rocketskip-skip-trace-property", + name: "Skip Trace Property", + description: "Send a property to get phone numbers for the property owner. [See the documentation](https://docs.rocketskip.com/api-reference/endpoint/post)", + version: "0.0.1", + type: "action", + props: { + app, + streetAddress: { + propDefinition: [ + app, + "streetAddress", + ], + }, + city: { + propDefinition: [ + app, + "city", + ], + }, + state: { + propDefinition: [ + app, + "state", + ], + }, + zipCode: { + propDefinition: [ + app, + "zipCode", + ], + }, + firstName: { + propDefinition: [ + app, + "firstName", + ], + }, + lastName: { + propDefinition: [ + app, + "lastName", + ], + }, + }, + async run({ $ }) { + const response = await this.app.skipTraceProperty({ + $, + data: { + street_address: this.streetAddress, + city: this.city, + state: this.state, + zip_code: this.zipCode, + first_name: this.firstName, + last_name: this.lastName, + }, + }); + $.export("$summary", "Successfully sent the request and retrieved " + response.result.length + " resultts"); + return response; + }, +}; diff --git a/components/rocketskip/package.json b/components/rocketskip/package.json index a9c5d036aa8c3..cb51269a0d48c 100644 --- a/components/rocketskip/package.json +++ b/components/rocketskip/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/rocketskip", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream RocketSkip Components", "main": "rocketskip.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} diff --git a/components/rocketskip/rocketskip.app.mjs b/components/rocketskip/rocketskip.app.mjs index 2d31bcc25d6b2..6422dae2f8aaf 100644 --- a/components/rocketskip/rocketskip.app.mjs +++ b/components/rocketskip/rocketskip.app.mjs @@ -1,11 +1,69 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "rocketskip", - propDefinitions: {}, + propDefinitions: { + streetAddress: { + type: "string", + label: "Street Address", + description: "Street address of the property, i.e.: `44 Montgomery St`", + }, + city: { + type: "string", + label: "City", + description: "City of the property, i.e.: `San Francisco`", + }, + state: { + type: "string", + label: "State", + description: "State of the property, i.e.: `CA`", + }, + zipCode: { + type: "string", + label: "Zip Code", + description: "Postal code of the property, i.e.: `94108`", + }, + firstName: { + type: "string", + label: "First Name", + description: "First name of the property owner", + optional: true, + }, + lastName: { + type: "string", + label: "Last Name", + description: "Last name of the property owner", + optional: true, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.rocketskip.com/api/v1"; + }, + async _makeRequest(opts = {}) { + const { + $ = this, + path, + headers, + ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + url: this._baseUrl() + path, + headers: { + Authorization: `Bearer ${this.$auth.oauth_access_token}`, + ...headers, + }, + }); + }, + + async skipTraceProperty(args = {}) { + return this._makeRequest({ + path: "/property/skiptrace", + method: "post", + ...args, + }); }, }, -}; \ No newline at end of file +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fde65cbc56037..1d21ad1eb7467 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10067,8 +10067,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/paazl: - specifiers: {} + components/paazl: {} components/paddle: {} @@ -12008,7 +12007,11 @@ importers: specifier: ^0.10.0 version: 0.10.0 - components/rocketskip: {} + components/rocketskip: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/rockset: dependencies: @@ -14584,8 +14587,7 @@ importers: specifier: ^1.6.2 version: 1.6.6 - components/trunkrs: - specifiers: {} + components/trunkrs: {} components/truss: {}