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
28 changes: 28 additions & 0 deletions components/trestle/actions/phone-validation/phone-validation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-phone-validation",
name: "Phone Validation",
description: "Validates phone numbers and provides phone metadata. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Phone-Validation-API#operation/getPhoneValidation)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.phoneValidation({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed phone validation");
return response;
},
};
86 changes: 86 additions & 0 deletions components/trestle/actions/real-contact/real-contact.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-real-contact",
name: "Real Contact",
description: "Verifies and grades phone numbers, emails, and addresses. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Real-Contact-API#operation/realContact)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
name: {
propDefinition: [
app,
"name",
],
},
email: {
propDefinition: [
app,
"email",
],
},
ipAddress: {
propDefinition: [
app,
"ipAddress",
],
},
street: {
propDefinition: [
app,
"street",
],
},
city: {
propDefinition: [
app,
"city",
],
},
stateCode: {
propDefinition: [
app,
"stateCode",
],
},
postalCode: {
propDefinition: [
app,
"postalCode",
],
},
countryCode: {
propDefinition: [
app,
"countryCode",
],
},
},
async run({ $ }) {
const response = await this.app.realContact({
$,
params: {
phone: this.phone,
name: this.name,
email: this.email,
ip_address: this.ipAddress,
address: {
street_line_1: this.street,
city: this.city,
state_code: this.stateCode,
postal_code: this.postalCode,
country_code: this.countryCode,
},
},
});
$.export("$summary", "Successfully executed contact lookup");
return response;
},
};
28 changes: 28 additions & 0 deletions components/trestle/actions/reverse-phone/reverse-phone.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-reverse-phone",
name: "Reverse Phone",
description: "Offers comprehensive verification and enrichment of phone numbers. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Reverse-Phone-API#operation/getPhone)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.reversePhone({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed reverse phone lookup");
return response;
},
};
Loading
Loading